Autodesk / notebook-molecular-visualization

2D and 3D molecular visualization in Jupyter notebooks using 3DMol.js and D3.js
http://moldesign.bionano.autodesk.com
Apache License 2.0
75 stars 21 forks source link

CI with Travis #28

Closed justinmc closed 7 years ago

justinmc commented 7 years ago

https://travis-ci.org/Autodesk/notebook-molecular-visualization

justinmc commented 7 years ago

@avirshup For now I just added a bogus test in here. I tried to import something from the project to at least write one useful test, but it seems that the naming of MolViz_3DMol causes pytest to choke when MDT imports it (probably due to the underscore). We should probably remove the underscore, and also maybe get rid of the dependency on MDT for units (which is what exposes the underscore error anyway).

avirshup commented 7 years ago

I'm pretty sure the problem here is just is a circular import (nbmolviz imports mdt which imports nbmolviz). I think you can fix this just by moving the import statement (from moldesign import units as u) out of the main body of the module and into the function definitions.

justinmc commented 7 years ago

That fixed it! Thanks.

justinmc commented 7 years ago

@avirshup Can I allow this to release a new version to see if it worked? What is your usual process? I'm assuming at least there's somewhere in the project where a version number is stored that I should increment.

avirshup commented 7 years ago

@justinmc - yeah, it would definitely be good to start automating releases!

Very important points for us to keep in mind:

  1. This version is API-incompatible with the previous nbmolviz releases, right? If so, then we can't do a full release until the next version of moldesign is ready, or we'll break everything :)
  2. Pre-release versions should be OK though. Anything that's tagged with an approved pre-release semantic version (e.g. 0.6.7-alpha1) can be uploaded to PyPI but won't be installed unless users specifically request it.

Releasing

Version numbers come directly from the git tag. In theory, this is how you release version X.Y.Z (without travis):

  1. Check out a clean copy of master
  2. Run check-manifest at project root to make sure the distribution will include the necessary files (install with pip install check-manifest if necessary.
  3. Tag your local branch with the release number: git tag [version] (note: delete this tag with git tag rm [version] if you need to abort)
  4. python setup.py sdist
  5. python setup.py register -r pypi
  6. python setup.py sdist upload -r pypi
  7. git push origin master --tags

Note that this doesn't actually include testing, which it really should :) The actual build artifact gets created when you run python setup.py sdist, and will be stored at dist/nbmolviz-X.Y.Z.tar.gz.

We definitely need a way to actually test the build artifact, though - I don't have a good process for doing it.

justinmc commented 7 years ago

Thank you for writing that up! I will make an attempt at this Monday. I forgot that this repo hadn't been deployed in awhile, I should probably do a manual deploy (when we're ready) first before I try to get Travis to do it.

avirshup commented 7 years ago

No problem!

I should say that the release process for nbmolviz should be more or less the same as for any other PyPI package that uses versioneer (which automatically synchronizes the package version number with the git tag). So probably the "right way" to get all this set up is to copy some other project that seems to have their sh*t together.

avirshup commented 7 years ago

Here's something to check out: https://github.com/pelson/package_with_continuous_delivery and an associated presentation: https://github.com/pelson/scipy15-presentation-keep-on-releasin

justinmc commented 7 years ago

@avirshup I seemed to be able to release a prerelease version by using your instructions (https://pypi.org/project/nbmolviz/#history). Now I'll try to get Travis to make a prerelease by tagging a commit here.

justinmc commented 7 years ago

@avirshup I think this is ready to merge, but let me know if I'm forgetting anything.

avirshup commented 7 years ago

Looks great - go for it!!! This should make our lives measurably easier. Thanks Justin!