Skip to content
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

Closed
wants to merge 13 commits into from
Closed

Add Python 3.10 tests #102

wants to merge 13 commits into from

Conversation

Kludex
Copy link

@Kludex Kludex commented Oct 1, 2021

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.

@Kludex
Copy link
Author

Kludex commented Oct 1, 2021

Hi @dvarrazzo ! 👋

Do you mind approving my workflow? I just want to check if on 3.10 is fine.

I'm working on the uvicorn process manager, and I'm thinking about using this package there. ✌️

@dvarrazzo
Copy link
Owner

Hi @Kludex nice to see you here around :)

@dvarrazzo
Copy link
Owner

Can you please name your commit better, such as "Add Python 3.10 tests", please? :)

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"]
Copy link
Owner

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

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see.

Copy link
Author

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.

Copy link
Owner

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.

Copy link
Author

@Kludex Kludex Oct 1, 2021

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.

@Kludex Kludex marked this pull request as draft October 1, 2021 15:59
.github/workflows/test.yml Outdated Show resolved Hide resolved
@Kludex Kludex changed the title Update test.yml Add Python 3.10 tests Oct 1, 2021
@Kludex Kludex marked this pull request as ready for review October 1, 2021 16:32
@Kludex Kludex requested a review from dvarrazzo October 1, 2021 16:32
.github/workflows/test.yml Outdated Show resolved Hide resolved
.github/workflows/test.yml Outdated Show resolved Hide resolved
.github/workflows/test.yml Outdated Show resolved Hide resolved
@Kludex
Copy link
Author

Kludex commented Oct 3, 2021

Ok, I did my best here. I've never used tox.

@Kludex Kludex requested a review from dvarrazzo October 3, 2021 20:44
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
Copy link
Owner

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:

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"]
Copy link
Owner

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]
Copy link
Owner

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.

@dvarrazzo
Copy link
Owner

dvarrazzo commented Oct 3, 2021

Ok, I did my best here. I've never used tox.

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 if of github actions rather than another package.

@wbolster
Copy link

it occurred to me that setproctitle does not currently have python 3.10 wheels on pypi, so installing it requires a compiler toolchain, which is not ideal (e.g. when building docker images).

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? 🙃

@dvarrazzo
Copy link
Owner

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...

@wbolster
Copy link

@dvarrazzo hmm fyi i found this

#47 (comment)

@dvarrazzo
Copy link
Owner

Python 3.10 tests added on master.

Trying to release binary packages for 3.10.

@dvarrazzo dvarrazzo closed this Apr 13, 2022
@wbolster
Copy link

thanks 🤩

@dvarrazzo
Copy link
Owner

FYI, setproctitile 1.2.3 released, including Py 3.10 packages, as well as many others (musllinux, M1...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants