Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autodeploy to PyPI from Travis CI #357

Merged
merged 4 commits into from Feb 29, 2020
Merged

Conversation

hugovk
Copy link
Member

@hugovk hugovk commented Feb 27, 2020

For #355.

In #352 (comment), @goanpeca kindly offered to help setting this up with GitHub Actions. I wanted to get something ready so we can get a release out soon, and I've used Travis for this before, but I'd still be very happy to change this over to GHA when ready. And this lays some useful groundwork for that.


This will deploy to TestPyPI on non-tagged merges to master, and to PyPI for tags.

It will be done only for this ultrajson/ultrajson repo, and only on a single CI job (arbitrarily, Python 3.8 on AMD64).

I created API tokens on Test PyPI and production PyPI, and encrypted the values using travis encrypt, so they're not available for pull requests from forks.

TestPyPI (and PyPI) only allows one upload per version number. To let it upload test versions for all merges to master without having to manually edit the version number, this uses setuptools_scm to move the version number out of a hardcoded file.

For tagged commits, it uses that tag version number. For commits in between tags, it increments the version based on the number of commits from the last tag. For example, right now:

$ python setup.py --version
1.36.dev61

Because the version number is actually needed in a header file for the C build, it will export it to an untracked file.

This generates an sdist and a bdist_wheel. I'm not sure exactly what sort of wheel this will create, I suggest we have a look at TestPyPI when this is merged, and we can decide whether to keep it, or remove it pending #219.

@hugovk hugovk added the release Deploy and release label Feb 27, 2020
@hugovk hugovk mentioned this pull request Feb 27, 2020
6 tasks
@hugovk hugovk merged commit be6fe2f into ultrajson:master Feb 29, 2020
@hugovk hugovk deleted the setuptools_scm branch February 29, 2020 08:52
@hugovk
Copy link
Member Author

hugovk commented Feb 29, 2020

HTTPError: 400 Client Error: Binary wheel 'ujson-1.36.dev62-cp38-cp38-linux_x86_64.whl' has an unsupported platform tag 'linux_x86_64'. for url: https://test.pypi.org/legacy/

https://travis-ci.com/ultrajson/ultrajson/jobs/292536375#L504

See pypi/warehouse#6545, let's remove bdist_wheel from Travis for now (PR #359) and we can address it in #219.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release Deploy and release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant