-
-
Notifications
You must be signed in to change notification settings - Fork 65
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
Add Python 3.10 tests #102
Conversation
Hi @dvarrazzo ! 👋 Do you mind approving my workflow? I just want to check if on 3.10 is fine. I'm working on the |
Hi @Kludex nice to see you here around :) |
Can you please name your commit better, such as "Add Python 3.10 tests", please? :) |
.github/workflows/test.yml
Outdated
jobs: | ||
linux-tests: | ||
name: Python ${{matrix.python-version}} tests on Linux | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
matrix: | ||
python-version: ["3.6", "3.7", "3.8", "3.9", "pypy3"] | ||
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10.0-rc.3", "pypy3"] |
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.
Yesterday I struggled quite some time to get the name right for Github Action. You should use something like: 3.10.0-alpha - 3.10.0
. But then you should make sure tox understands you ok. You can take a look to this commit for some "inspiration": psycopg/psycopg@ce86d80
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 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.
Hmm, but the alpha release is old... 🤔
https://www.python.org/dev/peps/pep-0619/#schedule
I guess you'd want to add the latest 3.10 on psycopg.
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 a range: it should select the most up-to-date version within the range. It picked up the rc2.
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.
Ah! Cool!
I'm trying this before: https://github.com/adamchainz/patchy/blob/main/.github/workflows/main.yml
If it doesn't work, I'll pursuit the solution what you did.
EDIT: It didn't work.
EDIT2: it did work with some conditions.
Ok, I did my best here. I've never used tox.
|
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{matrix.python-version}} | ||
architecture: x64 | ||
|
||
- name: Install Tox | ||
run: pip install tox | ||
run: pip install tox tox-gh-actions |
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.
This package is not necessary. Please organise the test suite as it is done in psycopg:
- there is no package needed on top of tox, which makes understand better how to use tox if you want to run the tests yourself
- the tox.ini is not so verbose and full of repetitions
- no test is running again: https://github.com/dvarrazzo/py-setproctitle/pull/102/checks?check_run_id=3784332477
jobs: | ||
linux-tests: | ||
name: Python ${{matrix.python-version}} tests on Linux | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
matrix: | ||
python-version: ["3.6", "3.7", "3.8", "3.9", "pypy3"] | ||
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10.0-beta - 3.10", "pypy3"] |
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 specify "3.10" here, and then, on setting up python, you can go selective:
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
if: ${{ matrix.python-version != '3.10' }}
- uses: actions/setup-python@v2
with:
python-version: "3.10.0-alpha - 3.10.0"
if: ${{ matrix.python-version == '3.10' }}
You could even rename python-version
to python
. Less typing :)
@@ -1,20 +1,31 @@ | |||
[gh-actions] |
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.
This works for sure, as it runs in psycopg test suite:
[tox]
envlist = {3.6,3.7,3.8,3.9,3.10}
isolated_build = True
[testenv]
commands =
pytest {posargs}
extras = test
gh-actions
is not necessary.
Thank you: it's very appreciated :)
Cool, thank you for the upgrade!
I am not aware of these needs, except the trick with 3.10 necessary until it will receive a final release, for which I prefer to use the builtin |
it occurred to me that i noticed this pull request has stalled, but it seems to be from before python 3.10 was released. any chance this can move forward now that python 3.10.4 is a thing? 🙃 |
Actually it looks like back in December I built Py10 packages, but haven't uploaded them. Can't remember if I found any problem doing so. Trying it again... |
@dvarrazzo hmm fyi i found this |
Python 3.10 tests added on master. Trying to release binary packages for 3.10. |
thanks 🤩 |
FYI, setproctitile 1.2.3 released, including Py 3.10 packages, as well as many others (musllinux, M1...) |
Add Python 3.10.0-rc.2 to the pipeline.
I've basically copied Adam's code: https://github.com/adamchainz/patchy/blob/main/.github/workflows/main.yml
Using tox-py (which I've just noticed has zero stars)
It does get the right version as you see here: https://github.com/dvarrazzo/py-setproctitle/pull/102/checks?check_run_id=3769535755
If you prefer the approach you did on psycopg, let me know. I took the opportunity to learn a little bit more about the options, so that's why I didn't directly do what you suggested.