Installer Scripts

make_dist script

Script to create a new distribution.

The following options are supported:

-help

Print documentation of this file and of setup.py

-local

Install the distribution as a local site-package. If a Pywikibot package is already there, it will be uninstalled first.

-remote

Upload the package to pypi. This cannot be done if the Pywikibot version is a development release.

-upgrade Upgrade distribution packages pip, setuptools, wheel and twine

first

Usage:

[pwb] make_dist [options]

Note

Requires Python 3.6+.

New in version 7.3.

Changed in version 7.4:

  • updates pip, setuptools, wheel and twine packages first

  • installs pre-releases over stable versions

  • also creates built distribution together with source distribution

  • -upgrade option was added

make_dist.cleanup()[source]

Remove all files which were copied to the pywikibot scripts folder.

Return type

None

make_dist.copy_files()[source]

Copy code entry point and i18n files to pywikibot.scripts folder.

pwb.py wrapper script is a console script entry point for the site-package. pywikibot i18n files are used for some translations. They are copied to the pywikibot scripts folder.

Return type

None

make_dist.handle_args()[source]

Handle arguments and print documentation if requested.

Read arguments from sys.argv and adjust it passing sdist to setuptools.setup.

Returns

Return whether dist is to be installed locally or to be uploaded

Return type

Tuple[bool, bool]

make_dist.main()[source]

Script entry point.

Return type

None

setup script

Installer script for Pywikibot framework.

How to create a new distribution:

  • replace the developmental version string in pywikibot.__metadata__.py by the corresponding final release

  • create the package with:

    make_dist remote
    
  • create a new tag with the version number of the final release

  • synchronize the local tags with the remote repositoy

  • merge current master branch to stable branch

  • push new stable branch to Gerrit and merge it the stable repository

  • prepare the next master release by increasing the version number in pywikibot.__metadata__.py and adding developmental identifier

  • upload this patchset to Gerrit and merge it.

setup.get_packages(name)[source]

Find framework packages.

setup.get_validated_version()[source]

Get a validated pywikibot module version string.

The version number from pywikibot.__metadata__.__version__ is used. setup.py with ‘sdist’ option is used to create a new source distribution. In that case the version number is validated: Read tags from git. Verify that the new release is higher than the last repository tag and is not a developmental release.

Returns

pywikibot module version string

Return type

str

setup.main()[source]

Setup entry point.

setup.python_is_supported()[source]

Check that Python is supported.

setup.read_desc(filename)[source]

Read long description.

Combine included restructured text files which must be done before uploading because the source isn’t available after creating the package.