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

Prepare for PyPI #110

Merged
merged 8 commits into from
Jan 21, 2019
Merged

Prepare for PyPI #110

merged 8 commits into from
Jan 21, 2019

Conversation

cthoyt
Copy link
Contributor

@cthoyt cthoyt commented Jan 20, 2019

This pull request closes #35 and makes it possible to deploy Saber to PyPI. It introduces the tox build system to run a couple of extra tests on Travis that check the integrity of the MANIFEST.in (see testenv:manifest in tox.ini) and the completeness of package metadata (see testenv:pyroma in tox.ini).

I was able to solve the problem with the external dependencies using a comment I found on StackOverflow referring to the newer system for specifying dependencies (see commit f79a3a3). After, I removed the requirements.txt since this is completely redundant of the setup.py and these are only supposed to be used for one-off projects, and not installable packages.

I'm not really sure if this broke the way code coverage was being uploaded to coveralls. I don't have any experience with that system because I've only used codecov before.

Please ask me lots of questions to explain any of the changes! If the coveralls thing doesn't work out we can try and figure that out together, too. I'm very excited to try using this myself now that I'm a bit more familiar with the codebase, and of course, that I will soon be able to use it in a reproducible way :)

Actually making the deployment

If you accept this PR and you're feeling ready to deploy to PyPI, you can use the following command, which makes use of the tox build system (see the tox.ini configuration file I added at the top level)

$ python3 -m pip install tox
$ tox -e release

Keep in mind that you can't upload the same version to PyPI ever again, so you have to bump up the version every time. It's also tricky to keep track of releases, so I'd suggest making use of the GitHub releases functionality as well so people know exactly what code in the repo made it to PyPI. Last, I'd suggest post-pending -dev to the version number between releases to help alleviate confusion

Use tox to run tests and codify build/deployment
Switch travis to use tox to run tests (not sure what the impact on coveralls will be. I've only ever used codecov so I'm not sure if this "adaptation" will work)
You don't need requirements.txt if you're a real library :)
@CLAassistant
Copy link

CLAassistant commented Jan 20, 2019

CLA assistant check
All committers have signed the CLA.

@coveralls
Copy link

coveralls commented Jan 20, 2019

Pull Request Test Coverage Report for Build 266

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at ?%

Totals Coverage Status
Change from base Build 265: 0.0%
Covered Lines:
Relevant Lines: 0

💛 - Coveralls

@JohnGiorgi
Copy link
Contributor

JohnGiorgi commented Jan 21, 2019

TL; DR Okay this is wicked, thanks a lot for setting this up. I am going to pull down this branch and try to use codacy for code coverage, and ditch coveralls. We already use codacy so this would mean one less tool. When that is done, I will go ahead and merge! As for submitting to PyPI, I will try my luck emailing the owner of the current saber project to see if they are willing to remove it so we can grab the name (see #35). Other than that, I may have to get you to walk me through what the workflow is like for using GitHub releases alongside PyPi... I will start reading in the meantime.


This pull request closes #35 and makes it possible to deploy Saber to PyPI. It introduces the tox build system to run a couple of extra tests on Travis that check the integrity of the MANIFEST.in (see testenv:manifest in tox.ini) and the completeness of package metadata (see testenv:pyroma in tox.ini).

I don't know much about tox but I will make a note to do some googling and bring myself up to speed! I think I understand the basics though.

I was able to solve the problem with the external dependencies using a comment I found on StackOverflow referring to the newer system for specifying dependencies (see commit f79a3a3). After, I removed the requirements.txt since this is completely redundant of the setup.py and these are only supposed to be used for one-off projects, and not installable packages.

Ah, I am glad you were able to solve this. I had basically given up.

I'm not really sure if this broke the way code coverage was being uploaded to coveralls. I don't have any experience with that system because I've only used codecov before.

I am going to pull down this branch and see if I can setup code coverage with codacy, which is another tool this project uses anyways. That would negate the need to use coveralls at all.

I'm very excited to try using this myself now that I'm a bit more familiar with the codebase, and of course, that I will soon be able to use it in a reproducible way :)

Thats great, excited someone else will be using the tool! I feel like I should excuse the codebase... I am not a software developer so there are bound to be design decisions and such that don't follow best practices. The API is also a little in flux (but the basic idea is to expose a few high-level methods to the user, e.g. load, save, train, annotate etc.). Please let me know if you have any trouble using the tool / any suggestions for improving the codebase.

Keep in mind that you can't upload the same version to PyPI ever again, so you have to bump up the version every time. It's also tricky to keep track of releases, so I'd suggest making use of the GitHub releases functionality as well so people know exactly what code in the repo made it to PyPI. Last, I'd suggest post-pending -dev to the version number between releases to help alleviate confusion

Okay I have never used GitHub releases so that is some more homework for me. Might have to touch base with you about what the workflow for GitHub releases + PyPi would look like.

@JohnGiorgi JohnGiorgi self-assigned this Jan 21, 2019
@JohnGiorgi
Copy link
Contributor

Ok, merging for now so we can snag saber on PyPI. Will fix code coverage stuff in another pull request.

@JohnGiorgi JohnGiorgi merged commit ddc166e into BaderLab:master Jan 21, 2019
@cthoyt cthoyt deleted the prepare-for-pypi branch January 21, 2019 15:14
JohnGiorgi added a commit that referenced this pull request Aug 3, 2019
Prepare for PyPI

Former-commit-id: 60cdcc0aa17ec8098717a7114482e996d70dd923 [formerly 19d90519a772118a40f0190b6dcdb91e981be59a] [formerly 7fc3e99c4a260babb9601ec8903d63c807c233b8 [formerly ddc166e]]
Former-commit-id: 9d6526030f75bd4299133f75d7562e9083b43b7a [formerly 2e506b406fd8365b7ca6402c3d57833ea7980618]
Former-commit-id: b68eb7b0f7d42dec06f381ca0f6d00881b7b7fb2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Publish this tool on PyPI
4 participants