-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Try building and testing Python package with tox
- Loading branch information
1 parent
df3af62
commit ce05828
Showing
3 changed files
with
82 additions
and
83 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
on: | ||
pull_request: | ||
push: | ||
branches: [main, master] | ||
|
||
name: python-build-and-test | ||
|
||
env: | ||
PYTHONUNBUFFERED: "1" | ||
|
||
jobs: | ||
build-and-test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install uv | ||
uses: astral-sh/setup-uv@v3 | ||
with: | ||
enable-cache: true | ||
cache-dependency-glob: python/pyproject.toml | ||
cache-suffix: test | ||
|
||
- name: Install Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install tox | ||
shell: bash | ||
run: | | ||
uv tool install tox --with tox-uv,tox-gh-actions | ||
tox --version | ||
- name: Build and test with tox | ||
shell: bash | ||
working-directory: python | ||
run: tox r |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,19 +9,19 @@ authors = [ | |
{name = "Dan Snow", email="[email protected]"}, | ||
] | ||
dependencies = [ | ||
"pandas>=1.4.0,<=2.3.0", | ||
"numpy>=1.23.0,<=2.2.0" | ||
"pandas>=1.4.3", | ||
"numpy>=1.23.1" | ||
] | ||
|
||
[project.optional-dependencies] | ||
dev = [ | ||
"mypy", | ||
"pytest", | ||
"mypy>=1.0.0", | ||
"pytest>=7.0.0", | ||
"ruff", | ||
] | ||
docs = [ | ||
"Sphinx", | ||
"myst-parser", | ||
"Sphinx>=7.0", | ||
"myst-parser>=3.0.0", | ||
"pydata-sphinx-theme", | ||
"sphinx-pyproject", | ||
"sphinx-autobuild" | ||
|
@@ -57,3 +57,35 @@ highlight_language = "none" | |
html_theme = "pydata_sphinx_theme" | ||
html_logo = "../images/logo.png" | ||
html_show_copyright = false | ||
|
||
[tool.pytest.ini_options] | ||
minversion = "7.0" | ||
addopts = "-v --cache-clear -rf --doctest-modules" | ||
console_output_style = "count" | ||
|
||
[tool.tox] | ||
legacy_tox_ini = """ | ||
[tox] | ||
min_version = 4.0 | ||
envlist = | ||
py{39, 310, 311}-lowest | ||
py{39, 310, 311, 312, 313} | ||
[gh-actions] | ||
python = | ||
3.9: py39 | ||
3.10: py310 | ||
3.11: py311 | ||
3.12: py312 | ||
3.13: py313 | ||
[testenv] | ||
extras = dev,docs | ||
commands = pytest | ||
[testenv:py{39, 310, 311}-lowest] | ||
uv_resolution = lowest-direct | ||
[testenv:py{310, 311, 312, 313}] | ||
uv_resolution = highest | ||
""" |