Skip to content

Commit

Permalink
DEVELOPER.md: add instructions on using twine with API tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
bxparks committed Jan 13, 2024
1 parent 6405d35 commit b236cfb
Showing 1 changed file with 33 additions and 7 deletions.
40 changes: 33 additions & 7 deletions DEVELOPER.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,45 @@ Install the following packages:
$ sudo -H pip3 install setuptools wheel twine
```

Starting sometime in 2023, 2FA is required on PyPI. In addition, `twine` no
longer accepts a password but requires an API token. See
https://pypi.org/manage/account/token/ on how to generate a token and how to
configure a `$HOME/.pypirc` file that contains this token. The file will look
like this:

```
[distutils]
index-servers =
pypi
bigquery-schema-generator
[pypi]
username = __token__
password = # insert user-scope or project-scoped token
[schemagenerator]
repository = https://upload.pypi.org/legacy/
username = __token__
password = # insert project-scoped token
```

### Steps

1. Increment the version numbers in:
* `version.py`
* `README.md`
* `CHANGELOG.md`
- `version.py`
- `README.md`
- `CHANGELOG.md`
1. Push all changes to `develop` branch.
1. Create a GitHub pull request (PR) from `develop` into `master` branch.
1. Merge the PR into `master`.
1. Create a new Release in GitHub with the new tag label.
1. Create the dist using `python3 setup.py sdist`.
1. Upload to PyPI using `twine upload
dist/bigquery-schema-generator-{version}.tar.gz`.
* Enter my PyPI login credentials.
* If `dist/` becomes too cluttered, we can remove the entire `dist/`
- If `dist/` becomes too cluttered, we can remove the entire `dist/`
directory and run `python3 setup.py sdist` again.
1. Upload to PyPI
- `$ twine upload dist/bigquery-schema-generator-{version}.tar.gz`, or
- `$ twine --repository schemagenerator upload
dist/bigquery-schema-generator-{version}.tar.gz`
- the `--repository PROJECT_NAME` flag is undocumented, seems to map to the
`[PROJECT_NAME]` section in the config file
- if this flag is omitted, then the `[pypi]` section appears to be used

0 comments on commit b236cfb

Please sign in to comment.