Skip to content

Add tox for easy testing of many Python versions #523

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

Merged
merged 2 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add tox for easy testing of many Python versions
  • Loading branch information
hugovk committed Jan 16, 2024
commit e2e7c392d92c645ed005bd2d6dbc3397f9b50aed
20 changes: 20 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Lint

on: [push, pull_request, workflow_dispatch]

env:
FORCE_COLOR: 1

permissions:
contents: read

jobs:
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- uses: pre-commit/action@v3.0.0
24 changes: 12 additions & 12 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ env:
FORCE_COLOR: 1

jobs:
build_ubuntu:
test:
strategy:
fail-fast: false
matrix:
Expand All @@ -15,27 +15,27 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
cache: pip
cache-dependency-path: ".github/workflows/tests.yml"
- name: setup

- name: Install dependencies
run: |
python --version
python -m pip install --upgrade pip
python -m pip install --upgrade pytest pytest-cov pyfakefs
- name: install
python -m pip install --upgrade tox

- name: Tox tests
run: |
cd blurb
tox -e py

python -m pip install -e .
- name: test
run: |
blurb test
- name: pytest
run: |
python -I -m pytest --cov blurb

- name: Upload coverage
uses: codecov/codecov-action@v3
with:
Expand Down
22 changes: 22 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-case-conflict
- id: check-merge-conflict
- id: check-toml
- id: check-yaml
- id: debug-statements

- repo: https://github.com/tox-dev/tox-ini-fmt
rev: 1.3.1
hooks:
- id: tox-ini-fmt

- repo: meta
hooks:
- id: check-hooks-apply
- id: check-useless-excludes

ci:
autoupdate_schedule: quarterly
40 changes: 26 additions & 14 deletions blurb/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,21 +1,33 @@
[build-system]
requires = ["flit_core >=2,<4"]
build-backend = "flit_core.buildapi"
requires = [
"flit_core<4,>=2",
]

[tool.flit.metadata]
module = "blurb"
author = "Larry Hastings"
author-email = "larry@hastings.org"
maintainer = "Python Core Developers"
maintainer-email = "core-workflow@mail.python.org"
home-page = "https://github.com/python/core-workflow/tree/main/blurb"
[project]
name = "blurb"
description = "Command-line tool to manage CPython Misc/NEWS.d entries."
readme = "README.rst"
maintainers = [{name = "Python Core Developers", email="core-workflow@mail.python.org"}]
authors = [{ name="Larry Hastings", email="larry@hastings.org"}]
requires-python = ">=3.8"
description-file = "README.rst"
classifiers = [
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python :: 3 :: Only"
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python :: 3 :: Only",
]

[tool.flit.scripts]
dynamic = [
"version",
]
[project.optional-dependencies]
tests = [
"pyfakefs",
"pytest",
"pytest-cov",
]
[project.urls]
Changelog = "https://github.com/python/core-workflow/tree/main/blurb#changelog"
Homepage = "https://github.com/python/core-workflow/tree/main/blurb"
Source = "https://github.com/python/core-workflow/tree/main/blurb"
[project.scripts]
blurb = "blurb:main"
21 changes: 21 additions & 0 deletions blurb/tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[tox]
requires =
tox>=4.2
env_list =
py{313, 312, 311, 310, 39, 38}

[testenv]
extras =
tests
pass_env =
FORCE_COLOR
commands =
{envpython} -I -m pytest \
--cov blurb \
--cov tests \
--cov-report html \
--cov-report term \
--cov-report xml \
{posargs}
blurb test
blurb help
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy