-
-
Notifications
You must be signed in to change notification settings - Fork 74
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
Streamline releasing and testing #202
Conversation
and improving testing. (1) Added conda recipe and package upload Builds and uploads conda packages for (non-PR/simulated) commits to master. I.e. latest master is always available as a conda package from anaconda.org/cball/param. (2) Added pypi package building and uploading For tags, builds sdist and universal wheel, and uploads to test.pypi (simulating actual releases to pypi). (3) Enabled testing on Windows via Appveyor. Param is pure python, but it's useful to test on windows to catch accidental platform specific content (whether that's code, developer workflow, testing, or whatever). Fixes #195. (4) Use tox for testing There is now very little scripting in the travis and appveyor config files (except for conda, which has no integration with travis). The same tests can be run locally as on CI. Nothing is platform specific. Tox not only tests 'python setup.py develop', but also creates an sdist, installs it, and tests it. Fixes #192. Changes include: * Moved dependencies out of platform-specific travis file and into setup.py (if genuine dependency) or tox (if test dependency). * Now tests that optional dependencies are actually optional. Previously, many other packages were present in the test environment. Have also started to test that specific functionality works when the optional dependencies are present. Fixes #189. * Fixed running of flake8. * Warnings during tests are now displayed (fixes #86). Being python only, param can take advantage of the standard python ecosystem, so unfortunately not all of this approach is suitable for conda-dependent packages. Also, minor updates to README, inclusing coverage badge (not sure why hiding it makes sense; closes #65).
Still got two things to address (noted with TODOs in setup.py, by commented-out code). Can't build or test sdist between releasessdist is the basis of a lot of packaging, and those packages are the things that actually get installed, so it makes sense to try creating, installing, and testing the sdist. However, can't currently do that:
"Latest master" conda packages will not have useful version infoAlthough the packages themselves will have a reasonable version (see ioam/parambokeh#15), the installed param package will have a version of just e.g. |
[ci skip]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great to me, and I look forward to having this all running smoothly. I'm not sure about the status of your two TODO items; looks like one can only be tested once on master (in which case pushing commits to master directly is ok by me), but I'm not sure about the other one.
- TOXENV: py33 | ||
- TOXENV: py27 | ||
- TOXENV: py26 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't suppose anyone has written a command for Appveyor that will import the relevant bits from .travis.yml to avoid duplication?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, sigh. At least it's overall a pretty short file now.
I think the ideal thing would be if appveyor and travis supported tox, then you'd only have the tox file. One problem on travis is that the 'build stages' I use here were added to travis fairly recently (they are still beta), so not even all of travis's own stuff seems to work with them yet. Otherwise I could maybe have used something like https://tox-travis.readthedocs.io/en/stable/.
I have used tox before on another project in the past (so it's been around a bit), and liked it. What I mainly like is that:
- the config is short...
- ...yet it covers a lot (particularly the testing of packages)
- and the config is separate from your code, i.e. does not tie itself in to your code. So (a) it is not a big deal to replace if something else comes along, and (b) I can use tox locally, but e.g. you don't have to if you don't want (you can just run one or more of the commands from tox.ini manually if you want, like
nosetests
).
It would be great if there were something providing similar functionality in the conda world, and if there were a conda plugin for travis, etc :)
.travis.yml
Outdated
- <<: *tests | ||
python: 3.5 | ||
env: TOX_ENV=py35 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a shame that this part had to get so verbose, but it seems worth it.
e.g. ``tox -e coverage`` to run unit tests with coverage for the | ||
currently active python. Alternatively, unit tests can be run via | ||
``nosetests`` (after installing `nose | ||
<http://nose.readthedocs.io/en/latest/>`_). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So you don't want to switch from nose to pytest?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I probably do want to - if only to match the bulk of other projects I encounter right now, not because I understand the difference ;)
I guess I was planning to switch at the same time as adding a unit test or two on parambokeh (just to get started there, not to try to test everything!!).
Right
This is the one I need to do something about (not just for this PR, but for parambokeh conda packages too). There are two parts to it. First, I'd like the python package in the conda package to have a meaningful version. I'm considering something like this (proposed by Jean-Luc): Second, I can't actually make sdist between tags at the moment, even to test them, without commenting out a version check. Jean-Luc has proposed modifying the commented-out guard in setup.py to |
setup.py
Outdated
# TODO: conda packages won't have meaningful version number yet | ||
|
||
# TODO: need to decide what to do about this | ||
# if ('upload' in sys.argv) or ('sdist' in sys.argv): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can also condition this on the presence of an environment variable when you need this check disabled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's what my earlier comment says ;) It's hard to follow because this same discussion was happening in parambokeh too. I'll try to keep it here, and I'll ping you to review when I actually try something. Thanks!
(I've never quite understood this line, because aside from sdist there's also various bdist args one might pass instead. And nowadays I'm not sure anyone would do 'python setup.py upload' - I will check that. So some of the delay is that I need to update myself on python packaging.)
…st step towards making it a module of param.
…ion in - dists created between official, tagged releases.
…eliable process rather than a manual one that's prone to error. Bad version will generate setuptools error? Version you don't like will be visible in package name.
@jlstevens, it would be great if you could comment on the behavior I describe below - thanks! Recent hacks mean this can't currently be merged, but they show behavior that's getting closer to what I think I want. Basically, the idea is that every new PR merge (i.e. commit) to master will result in a new "dev" release being uploaded to anaconda.org automatically.
Similarly, (I think conda supports pep440, so the conda package name could maybe be |
@jlstevens and @jbednar: the recent commits to this PR leave it demonstrating (at least in my mind...) how versioneer allows the workflow described in holoviz-dev/autover#2. (Albeit I have not changed from the 'pre' versioning scheme I described before Jim suggested a better alternative.) However: the >2000 lines of versioneer I'm sure revokes Jim's previous review approval ;) I don't propose to merge this, but I would love to have all projects operating like this. conda packages of master are always available (see https://anaconda.org/cball/param/files - although here they are enabled for the branch, because I am testing), and 'release candidates' can be made any time with a |
And holoviz-dev/autover#9 sets up the same workflow on autover itself (but not working), as a target. |
Apart from the 2000 lines, that all sounds good to me. Hopefully Jean-Luc can get that down to 20. |
This PR's been open for over 2 months now. @jbednar, I've removed the versioneer demo, so do you re-approve of merging? |
@@ -0,0 +1,40 @@ | |||
""" | |||
If numpy's present, is numpy stuff ok? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be nice to have a better description here...
Yes, I re-approve of merging. |
…loy to own stage and temporarily enabled to test.
This is a PR about streamlining param releases (fixes #167), and
improving testing.
Added conda recipe and package upload
Builds and uploads conda packages for (non-PR/simulated) commits to master. I.e. latest master is always available as a conda package from anaconda.org/cball/param.
Added pypi package building and uploading
For tags, builds sdist and universal wheel, and uploads to test.pypi (simulating actual releases to pypi).
Enabled testing on Windows via Appveyor.
Param is pure python, but it's useful to test on windows to catch accidental platform specific content (whether that's code, developer workflow, testing, or whatever). Fixes Test on appveyor #195.
Use tox for testing
There is now very little scripting in the travis and appveyor config files (except for conda, which has no integration with travis). The same tests can be run locally as on CI. Nothing is platform specific.
Tox not only tests 'python setup.py develop', but also creates an sdist, installs it, and tests it. Fixes Travis should test setup.py and resulting package #192.
Changes include:
Moved dependencies out of platform-specific travis file and into setup.py (if genuine dependency) or tox (if test dependency).
Now tests that optional dependencies are actually optional. Previously, many other packages were present in the test environment. Have also started to test that specific functionality works when the optional dependencies are present. Fixes Travis: test different environments #189.
Fixed running of flake8.
Warnings during tests are now displayed (fixes nosetests should display warnings #86).
Being python only, param can take advantage of the standard python ecosystem, so unfortunately not all of this approach is suitable for conda-dependent packages.
Also, minor updates to README, including coverage badge (not sure why hiding it makes sense; closes #65).