Mercurial > public > mercurial-scm > hg
annotate contrib/automation/hgautomation/pypi.py @ 43881:b5655f337bd7
typing: add a couple of assertions to lrucachedict to help pytype
Fixes the following warnings:
line 1488, in pop: No attribute 'markempty' on None [attribute-error]
In Optional[Union[Any, _lrucachenode, nothing]]
line 1578, in popoldest: No attribute 'markempty' on None [attribute-error]
In Optional[Union[Any, _lrucachenode, nothing]]
Differential Revision: https://phab.mercurial-scm.org/D7674
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Sun, 15 Dec 2019 21:28:30 -0500 |
parents | 2372284d9457 |
children |
rev | line source |
---|---|
42907
92593d72e10b
automation: implement "publish-windows-artifacts" command
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
1 # pypi.py - Automation around PyPI |
92593d72e10b
automation: implement "publish-windows-artifacts" command
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
2 # |
92593d72e10b
automation: implement "publish-windows-artifacts" command
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
3 # Copyright 2019 Gregory Szorc <gregory.szorc@gmail.com> |
92593d72e10b
automation: implement "publish-windows-artifacts" command
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
4 # |
92593d72e10b
automation: implement "publish-windows-artifacts" command
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
5 # This software may be used and distributed according to the terms of the |
92593d72e10b
automation: implement "publish-windows-artifacts" command
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
6 # GNU General Public License version 2 or any later version. |
92593d72e10b
automation: implement "publish-windows-artifacts" command
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
7 |
92593d72e10b
automation: implement "publish-windows-artifacts" command
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
8 # no-check-code because Python 3 native. |
92593d72e10b
automation: implement "publish-windows-artifacts" command
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
9 |
43076
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
42907
diff
changeset
|
10 from twine.commands.upload import upload as twine_upload |
2372284d9457
formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents:
42907
diff
changeset
|
11 from twine.settings import Settings |
42907
92593d72e10b
automation: implement "publish-windows-artifacts" command
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
12 |
92593d72e10b
automation: implement "publish-windows-artifacts" command
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
13 |
92593d72e10b
automation: implement "publish-windows-artifacts" command
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
14 def upload(paths): |
92593d72e10b
automation: implement "publish-windows-artifacts" command
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
15 """Upload files to PyPI. |
92593d72e10b
automation: implement "publish-windows-artifacts" command
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
16 |
92593d72e10b
automation: implement "publish-windows-artifacts" command
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
17 `paths` is an iterable of `pathlib.Path`. |
92593d72e10b
automation: implement "publish-windows-artifacts" command
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
18 """ |
92593d72e10b
automation: implement "publish-windows-artifacts" command
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
19 settings = Settings() |
92593d72e10b
automation: implement "publish-windows-artifacts" command
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
20 |
92593d72e10b
automation: implement "publish-windows-artifacts" command
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
21 twine_upload(settings, [str(p) for p in paths]) |