-
Notifications
You must be signed in to change notification settings - Fork 16
setup multibuild for compiling multi-platform wheels #55
Conversation
the root .coveragerc is enough
always relative to the current working directory, so we can run test modules from anywhere
py.path is part of pytest (tmpdir fixture itself returns a py.path.local object)
remove parallel=True as it conficts with pytest-cov and pytest-xdist; add .tox site-packages folders to 'paths' for combining coverage.
so one can install them, e.g.: pip install -e .[testing]
Several changes, including: - we now use pytest-xdist plugin to distribute tests across several processes, depending on the CPU cores (-n auto) - py37 added to default envlist (but skipped if not present on local developer's machine) - pytest now searches in 'testpaths = tests' when no input is given; runs in verbose mode, with a summary report at the end - coverage data files for each tox environment are saved inside the .tox work dir, then are combined by a specific 'coverage' tox environment which must be run at the end, and which combines and produces reports in different formats: console, xml (for codecov), and html (saved in 'htmlcov') for inspecting locally in a browser.
we only need to run tox -e sdist on the CI before uploading to PyPI. I keep 'tox -e bdist' in case one may want to create the wheel locally
for now only 2.7 and 3.6 (64-bit) for both linux (wide unicode) and mac. No deploy stage yet.
run_tests will search for the precompiled psautohint wheel inside 'wheelhouse' dir and call tox with --installpkg (to skip rebuilding from sdist).
codacy is very picky.. didn't know it also linted bash! :) |
need to tell tox where to find the path to the python interpreter on Windows (do I?)
…se it ourside docker container
appveyor is very slow, not so much the single build (5-6 min each) but the fact that unlike Travis, it doesn't run in parallel with the other matrix builds. anyway, i'll complete this tomorrow. |
installing pip seems to break multibuild osx 2.7 build somehow. https://travis-ci.org/adobe-type-tools/psautohint/jobs/400583973
the linux builds fail because they can't read/write the .tox folder..
I think these should work...
I'm not an admin on the appveyor account, so I cannot store my encrypted PyPI password as |
I didn't mean to be rude with our Coday bot, it's doing its job :) |
The Codacy review link is pointing to the wrong page; #50 is tracking that. The correct link is https://app.codacy.com/app/adobe-type-tools/psautohint/pullRequest?prid=1867014 I'll look into providing twine credentials for this repo. |
ok the pr is ready for review/merge now. I'm sure there'll be more fixes needed after we try to push the next tag. |
for Travis I added my PyPI username/password since I'm a collaborator on both this repo and the linked PyPI page, so they will work. $ echo "<your-password-here>" | travis encrypt -R adobe-type-tools/psautohint --add deploy.password Then you'll notice that the .travis.yml file will have been reformatted with indentation and empty line separators all messed up. What I usually do is copy/paste the |
.travis.yml
Outdated
@@ -24,6 +24,8 @@ env: | |||
- TEST_DEPENDS="-rdev-requirements.txt" | |||
- PLAT=x86_64 | |||
- UNICODE_WIDTH=32 | |||
- TWINE_USERNAME=adobe-type-tools-ci | |||
# TWINE_PASSWORD is set in Travis settings |
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.
@miguelsousa are you sure that setting these environment variable works with Travis deploy too?
It does also use twine under the hood, so it should work. But I've never tried. Anyway we'll see
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 how they're used in this repo https://github.com/joerick/pyinstrument_cext
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.
actually, it failed to deploy without 'user' defined:
https://travis-ci.org/adobe-type-tools/psautohint/jobs/401042408#L878
I fixed it here: 65f9234
🤞
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.
.. And also the 'password' field is required:
https://travis-ci.org/adobe-type-tools/psautohint/jobs/401053332#L878
I'm using mine just to test. The reason that alternative method works is because it calls twine directly (like we do with Appveyor), whereas in Travis we are using the dpl
tool (which requires those settings in the .travis.yml, and in turns calls twine with them).
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.
👌
the afdko repo uses a script to deploy to PyPI from Travis
https://github.com/adobe-type-tools/afdko/blob/develop/.travis.yml#L117
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.
@miguelsousa can you please cancel this appveyor build for me?
https://ci.appveyor.com/project/adobe-type-tools/psautohint/build/1.0.256
I don't seem to have access to it, even despite I saw your invite in my email. The address is correct, not sure why it isn't working :-/
I'm logged in Appveyor with my github username @anthrotype
anyway we need to stop that appveyor build before travis pushes a new release which is going to be newer than the one appveyor is trying to push :(
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.
@anthrotype cancelled. Try logging into AppVeyor using your email address. The invitation is still showing up as not having been accepted.
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 did! The link asks me to "sign up" but of course I am already signed up... so I click the button to login with github and select "anthrotype" among several organizational accounts (e.g. fonttools, trufont, etc. but not afdko...), but then nothing happens. I don't seem to be able to cancel or restart the builds. Anyway, no problem. no big deal
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.
@anthrotype I've reconfigured the access to AppVeyor to use GH teams. Accept the invitation to https://github.com/orgs/adobe-type-tools/teams/psautohint-team and then check AppVeyor to see if you're able to restart builds now
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.
Thanks Miguel! Yeah, that should do it.
btw, I'm happy to report that auto-upload to pypi from travis/appveyor is now working:
https://pypi.org/project/psautohint/1.1.1a6/#files
oops you merged too fast, or we didn't coordinate :) https://ci.appveyor.com/project/adobe-type-tools/psautohint/build/1.0.246/job/dojxioahaa9nd753#L198 I added some commits that broke the appveyor build |
you said this was ready to merge, so after changing the twine credentials I did it. |
you're right, sorry about that :) |
@miguelsousa I pushed the fix to master, can you please stop the previous Appveyor builds, so that the last one can start? I can stop Travis builds, but not Appveyor's |
the last couple of commits to .appveyor.yml were a minor optimization, to avoid having to compile the module from source twice: i.e. once when tox installs it into its test environments, and again before uploading the wheel to PyPI. it's working now: |
@miguelsousa I'll work on adding python3.7 wheels later (appveyor doesn't ship with 3.7 yet, but we can download/install it ourselves). I think you can try tagging a prerelease and see if it pushes the wheels. It never works at first try -- no matter how many times we set this things up over and over 😄 |
@anthrotype I'm not sure what tags you guys want to use, so you go ahead with the prerelease |
ok, I'll try in a bit. I noticed that we have two sets of version strings, one in setup.py (1.1.1.dev0) which is in sync with the git tag, and another one for the libpsautohint C library (1.6.0). The psautohint --version currently prints the latter. /cc @khaledhosny |
@anthrotype I prefer a single version as well. It should match the version of the wheel. |
This seems to have squashed and merged as a single commit, something I strongly dislike myself. Though keeping each of the original commits might be too much, at least commits should be grouped into some reasonable units e.g. why opening files in UTF-8 encoding is in the same commit with the changes to the test suite? If one of these two unrelated changes proved problematic in the future, reverting that bit will be unnecessarily complicated, the same goes for git bisecting to find the source of a regression. |
I agree with Khaled. I never click merge&squash button on Github. I prefer to squash commits manually into logical groups. It was inevitable that there were many small commits because of the trial and error when dealing with CIs. Next time there's a big PR like this, we could let the dev do the squashing manually after the reviewer has approved. |
No objection to single version, it should probably be based on the current C library version. So probably 1.7.0something. |
btw, the changes to open files as UTF-8 were necessary in order to let the tests pass on the manylinux1 docker which sets LANG=C locale and thus open text files as ascii by default, unless explicitly told encoding="utf-8". |
Sorry, going forward I'll leave the merging part up to you two. I prefer to merge&squash when there are too many minute changes that are toward the same goal. |
follow up from #42