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 tox for easy testing of multiple Python versions #100

Merged
merged 2 commits into from
Nov 24, 2023

Conversation

hugovk
Copy link
Collaborator

@hugovk hugovk commented Nov 6, 2023

For example:

# Test with one Python version (e=environment)
tox -e py312

# Test with all installed versions
tox

# Test with all installed versions, in parallel
tox -p auto

Also use tox on the CI, test with coverage, and upload coverage to Codecov.

Coverage is an impressive 91.29%!

Also adds PyPy3.10 to the test matrix.

@ezio-melotti
Copy link
Collaborator

Does this PR replace #68?

@hugovk
Copy link
Collaborator Author

hugovk commented Nov 10, 2023

It replaces some of it, but that also includes some linting stuff. I was also planning on adding some pre-commit based linting after this is merged.

@JulienPalard
Copy link
Collaborator

I have a very bad experience with pytest-cov running in parallel (inside tox -p all), to the point I took the habit to just use coverage run -m pytest (which is not much more to type).

See: pytest-dev/pytest-cov#416

Is your experience different? Maybe it has been somehow fixed by now?

@hugovk
Copy link
Collaborator Author

hugovk commented Nov 23, 2023

Hmm, I often use tox -p auto and haven't noticed that.

I added this to the top of sphinxlint.py:

import sys

if sys.version_info >= (3, 10):
    a = 1
else:
    a = 2

Ran tox -p all and it showed as covered:

image

Maybe it's fixed? Or I'm not running into it for some reason?

@JulienPalard
Copy link
Collaborator

Maybe it's fixed? Or I'm not running into it for some reason?

Maybe.

If we spot sqlite/coverage related errors, we know how to fix it (but just not using pytest-cov).

Let's try your way.

@hugovk hugovk merged commit f5ee878 into sphinx-contrib:main Nov 24, 2023
20 checks passed
@hugovk hugovk deleted the add-tox branch November 24, 2023 13:10
@hugovk
Copy link
Collaborator Author

hugovk commented Nov 24, 2023

Sounds good.

lengau referenced this pull request in canonical/craftcraft Dec 15, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [docs/sphinx-lint](https://github.com/sphinx-contrib/sphinx-lint)
([changelog](https://github.com/sphinx-contrib/sphinx-lint/releases))
| `==0.8.2` -> `==0.9.1` |
[![age](https://developer.mend.io/api/mc/badges/age/pypi/docs%2fsphinx-lint/0.9.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/pypi/docs%2fsphinx-lint/0.9.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/pypi/docs%2fsphinx-lint/0.8.2/0.9.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/docs%2fsphinx-lint/0.8.2/0.9.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>sphinx-contrib/sphinx-lint (docs/sphinx-lint)</summary>

###
[`v0.9.1`](https://github.com/sphinx-contrib/sphinx-lint/releases/tag/v0.9.1)

[Compare
Source](https://github.com/sphinx-contrib/sphinx-lint/compare/v0.9.0...v0.9.1)

#### What's Changed

- Add `tool.hatch.build.targets.wheel` to fix `pip install .` with
Hatchling 1.19 by [@&#8203;hugovk](https://github.com/hugovk) in
[https://github.com/sphinx-contrib/sphinx-lint/pull/106](https://github.com/sphinx-contrib/sphinx-lint/pull/106)
This fixes `ValueError: Unable to determine which files to ship inside
the wheel using the following heuristics: [...]` when trying to `pip
install .`, including via pre-commit.
- Add tox for easy testing of multiple Python versions by
[@&#8203;hugovk](https://github.com/hugovk) in
[https://github.com/sphinx-contrib/sphinx-lint/pull/100](https://github.com/sphinx-contrib/sphinx-lint/pull/100)
- Lint on GitHub Actions via pre-commit by
[@&#8203;hugovk](https://github.com/hugovk) in
[https://github.com/sphinx-contrib/sphinx-lint/pull/104](https://github.com/sphinx-contrib/sphinx-lint/pull/104)

**Full Changelog**:
sphinx-contrib/sphinx-lint@v0.9.0...v0.9.1

###
[`v0.9.0`](https://github.com/sphinx-contrib/sphinx-lint/releases/tag/v0.9.0)

[Compare
Source](https://github.com/sphinx-contrib/sphinx-lint/compare/v0.8.2...v0.9.0)

#### What's Changed

- Print error messages to stderr by
[@&#8203;rffontenelle](https://github.com/rffontenelle) in
[https://github.com/sphinx-contrib/sphinx-lint/pull/102](https://github.com/sphinx-contrib/sphinx-lint/pull/102)

#### New Contributors

- [@&#8203;rffontenelle](https://github.com/rffontenelle) made their
first contribution in
[https://github.com/sphinx-contrib/sphinx-lint/pull/102](https://github.com/sphinx-contrib/sphinx-lint/pull/102)

**Full Changelog**:
sphinx-contrib/sphinx-lint@v0.8.2...v0.9.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "every weekend" in timezone Etc/UTC,
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/canonical/craftcraft).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy41OS44IiwidXBkYXRlZEluVmVyIjoiMzcuOTMuMSIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
@hugovk hugovk mentioned this pull request Mar 8, 2024
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.

3 participants