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

Update setup.py and test flow #403

Merged
merged 1 commit into from Mar 5, 2018
Merged

Update setup.py and test flow #403

merged 1 commit into from Mar 5, 2018

Conversation

ob-stripe
Copy link
Contributor

r? @brandur-stripe
cc @stripe/api-libraries

(This is for the upcoming v2.0.)

Update setup.py and test flow:

  • refactor setup.py to use best practices described in https://github.com/pypa/sampleproject/blob/master/setup.py

  • bump minimum requests version to 2 (current major version)

  • add requests[security] to dependencies for Python 2. This should help with TLS 1.2 issues, e.g. when using the default OS X Python interpreter.

  • removed pytest-runner from setup_requires to avoid installing the package for every setup.py invocation. Instead use a custom PyTest command as described here.

  • use pytest-xdist to distribute tests over multiple cores. This is not very useful when running tests on a reasonably powerful local machine, but gives a noticeable speed increase on Travis.

  • use find_packages to discover packages automatically

  • Greatly simply tox.ini by putting coverage and flake8 configurations in dedicateds files, and simply running python setup.py test

  • Don't install pycurl package when running tests as it wasn't actually used anywhere

  • Remove allow_failures from Travis configuration as we probably want to not merge PRs that break PyPy or 3.7 compatibility

@ob-stripe ob-stripe mentioned this pull request Mar 5, 2018
7 tasks
@brandur-stripe
Copy link
Contributor

Nice cleanups!

Just to confirm, all test invocations are still the same right? i.e., no changes are required in README.md or anything?

LGTM.

@ob-stripe
Copy link
Contributor Author

Just to confirm, all test invocations are still the same right? i.e., no changes are required in README.md or anything?

Oh, good point, my update to tox.ini broke the possibility of passing custom parameters. This is now fixed: if you don't pass any parameters, then it will run with -n auto (which spreads tests over as many workers as there are CPU cores), otherwise it will use your parameters. The examples from the README will still work.

@ob-stripe ob-stripe merged commit fce31d5 into integration-v2 Mar 5, 2018
@ob-stripe ob-stripe deleted the ob-update-setup branch March 5, 2018 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants