-
Notifications
You must be signed in to change notification settings - Fork 21
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
Port CI to GitHub Actions #57
Conversation
I was just about to ask you if you wanted direct access to the repository, so that suits me fine. |
That would be ideal, yeah, thanks. I wouldn't touch |
@regebro After fixing the tests to translate newlines properly, looks like I got them working on all platforms and interpreters, except for PyPy-3.7 on Windows. Seems like what's going on is because, as mentioned in PR #58 , the setup.py in the obsolete, unmaintained distribute package doesn't close files properly (which PyPI is particularly sensitive to), and To address this, I will try replacing the low-level The better long-term solution, I think, is to avoid using |
456ccce
to
199ca1b
Compare
199ca1b
to
65de857
Compare
Relying on the implicit destructor behavior of To fix this, I instead revert to the previous approach using This produces all green tests across the board, so this should be good to merge to master once you review and approve. It should still be fixed long-term by relying something other than I'll submit a BPO upstream to the Python bug tracker to propose implementing an |
Proposed on BPO-29982 |
"The better long-term solution, I think, is to avoid using exec which is the root cause of these problems, and instead build a sdist in a subprocess and then read the written-out metadata in the standard format from there with e.g. importlib_metadata (you might have to get the built package on the PYTHONPATH first)." Yeah, that could be a solution. I've been trying a lot of solutions, but making a parser for the built metadata was not something I felt like doing. Now when somebody else has done it, that would work. The exec() solution was always just a final resort because nothing else worked. :-) |
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.
Seems good to me.
As mentioned in PR #53 , I've ported this repo's CI setup to Github Actions following the recommend best practices, cleaning up some deprecated/obsolete syntax in the commands along the way.
In addition, I've refined the test runner call to check invalid bytes/string/int/etc comparisons (
-bb
); enable Python development mode to print warnings (e.g. forthcoming deprecations), provide more useful output on errors, and enable several additional runtime checks (-X dev
); ignore the presumably expected invalid version warning (-W ignore::UserWarning:setuptools.dist
), and enable more informativeunittest
output for debugging and verification (-v
).Finally, I've expanded the test matrix to test all three major platforms (Linux, Windows and macOS) to avoid regressions like #28 from being introduced in the future, while bookending the text matrix with the minor versions supported (given Python's 5-year deprecation policy, the probability of a failure on an intermediate version is vanishingly small, and furthermore 3.7 is still tested through PyPI).
From my experience, for security reasons newly-added actions won't actually run on the PR that adds them unless the PR feature branch is on this repo, not mine, so it is not possible to actually test this as-is. Options to deal with this:
add-github-actions
on this repo and I can retarget this PR against that; the actions will only run after you merge this PR to that branch and any fixes would require more PRs, but at least we can treat that branch as a feature branch and you can do fixups/squashing/cleanup as necessary once everything's working before merging tomaster