Skip to content

Commit 64c1bf3

Browse files
Merge pull request #34 from adamtheturtle/twine
Progress towards a release
2 parents d32b426 + 9a21478 commit 64c1bf3

File tree

5 files changed

+47
-1
lines changed

5 files changed

+47
-1
lines changed

CONTRIBUTING.rst

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,38 @@ Prerequisites
205205
Perform a Release
206206
~~~~~~~~~~~~~~~~~
207207

208+
#. Install keyring
209+
210+
Make sure that `keyring <https://pypi.org/project/keyring/>`__ is available on your path.
211+
212+
E.g.:
213+
214+
.. code:: sh
215+
216+
curl https://raw.githubusercontent.com/mitsuhiko/pipsi/master/get-pipsi.py | python
217+
pipsi install keyring
218+
219+
#. Set up PyPI credentials
220+
221+
Register at `PyPI <https://pypi.org>`__.
222+
223+
Add the following information to ``~/.pypirc``.
224+
225+
.. code:: ini
226+
227+
[distutils]
228+
index-servers=
229+
pypi
230+
231+
[pypi]
232+
username = <Your PyPI username>
233+
234+
Store your PyPI password:
235+
236+
.. code:: sh
237+
238+
keyring set https://upload.pypi.org/legacy/ <Your PyPI username>
239+
208240
#. Get a GitHub access token:
209241

210242
Follow the `GitHub instructions <https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/>`__ for getting an access token.

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ fix-yapf:
77
--recursive \
88
--exclude versioneer.py \
99
--exclude src/mock_vws/_version.py \
10+
--exclude build \
1011
.
1112

1213
.PHONY: autoflake
@@ -38,6 +39,7 @@ lint:
3839
--diff \
3940
--recursive \
4041
--exclude versioneer.py \
42+
--exclude build \
4143
--exclude src/mock_vws/_version.py \
4244
.
4345

admin/release.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,14 @@ def build() -> None:
107107
subprocess.run(args=args, check=True)
108108

109109

110+
def upload_to_pypi() -> None:
111+
"""
112+
Upload builds to PyPI.
113+
"""
114+
args = ['twine', 'upload', '-r', 'pypi', 'dist/*']
115+
subprocess.run(args=args, check=True)
116+
117+
110118
def main() -> None:
111119
"""
112120
Perform a release.
@@ -118,6 +126,7 @@ def main() -> None:
118126
update_changelog(version=version_str)
119127
commit_and_push(version=version_str, repository=repository)
120128
build()
129+
upload_to_pypi()
121130
create_github_release(
122131
repository=repository,
123132
version=version_str,

dev-requirements.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ flake8-quotes==1.0.0 # Require single quotes
1010
freezegun==0.3.10 # Freeze time in tests
1111
hypothesis==3.71.1 # Generate test cases
1212
isort==4.3.4 # Lint imports
13+
keyring==15.0.0
1314
mypy==0.620 # Type checking
1415
pip_check_reqs==2.0.3
1516
pydocstyle==2.1.1 # Lint docstrings
@@ -21,6 +22,7 @@ pytest-cov==2.6.0 # Measure code coverage
2122
pytest-envfiles==0.1.0 # Use files for environment variables for tests
2223
pytest==3.8.0 # Test runners
2324
timeout-decorator==0.4.0 # Decorate functions to time out.
25+
twine==1.11.0
2426
vulture==0.29
2527
yapf==0.24.0 # Automatic formatting for Python
26-
PyYAML==3.13
28+
PyYAML==3.13

setup.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ ignore =
3939
[flake8]
4040
exclude=./versioneer.py,
4141
./src/mock_vws/_version.py,
42+
./build/,
4243

4344
[versioneer]
4445
VCS = git

0 commit comments

Comments
 (0)