jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/807579 )
Change subject: [dist] Provide Built Distribution with Pywikibot (PEP 427) ......................................................................
[dist] Provide Built Distribution with Pywikibot (PEP 427)
- update pip, setuptools, wheel and twine package first when running make_dist.py wth -upgrade option - create source distribution and built distibution; both are stored in the dist folder - pip prefers built distibution over source distribution automatically; source distribution is for fallback or older pip versions
Change-Id: I0974ddb736223d6a1dd95054f314c7789c7761a7 --- M make_dist.py 1 file changed, 16 insertions(+), 5 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/make_dist.py b/make_dist.py index dd67875..21271c3 100644 --- a/make_dist.py +++ b/make_dist.py @@ -12,14 +12,21 @@ -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+ +.. note:: Requires Python 3.6+. .. versionadded:: 7.3 .. versionchanged:: 7.4 - installs pre-releases over stable versions + + - 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 """ # # (C) Pywikibot team, 2022 @@ -91,20 +98,24 @@
local = '-local' in sys.argv remote = '-remote' in sys.argv + upgrade = '-upgrade' in sys.argv
if remote and 'dev' in __version__: warning('Distribution must not be a developmental release to upload.') remote = False
- sys.argv = [sys.argv[0], 'sdist'] - return local, remote + sys.argv = [sys.argv[0], 'sdist', 'bdist_wheel'] + return local, remote, upgrade
def main() -> None: """Script entry point.""" - local, remote = handle_args() + local, remote, upgrade = handle_args()
copy_files() + if upgrade: + subprocess.run('python -m pip install --upgrade pip') + subprocess.run('pip install --upgrade setuptools wheel twine ')
try: setup.main() # create a new package
pywikibot-commits@lists.wikimedia.org