Skip to content

Commit 81a0579

Browse files
authored
Merge pull request #14 from Princeton-CDH/chore/10-gh-actions
Migrate from Tox to Github actions; add missing unit tests to pytest scope (#10)
2 parents a2850a1 + 973e774 commit 81a0579

13 files changed

Lines changed: 137 additions & 94 deletions

File tree

.codeclimate.yml

Lines changed: 0 additions & 16 deletions
This file was deleted.

.coveragerc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
[run]
22
source = neuxml
3-
4-
[report]
53
omit =
6-
*/python?.?/*
7-
*/site-packages/nose/*
4+
# omit generated PLY files from coverage
5+
lextab.py
6+
parsetab.py

.github/workflows/unit_tests.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: unit tests
2+
3+
on:
4+
push: # run on every push or PR to any branch
5+
pull_request:
6+
schedule: # run automatically on main branch each Tuesday at 11am
7+
- cron: "0 16 * * 2"
8+
9+
jobs:
10+
python-unit:
11+
name: Python unit tests
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
python: ["3.10", "3.11", "3.12", "3.13"]
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
20+
- name: Setup Python
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: ${{ matrix.python }}
24+
25+
# We base the python cache on the hash of all requirements files, so that
26+
# if any change, the cache is invalidated.
27+
- name: Cache pip
28+
uses: actions/cache@v4
29+
with:
30+
path: ~/.cache/pip
31+
key: pip-${{ hashFiles('pyproject.toml') }}
32+
restore-keys: |
33+
pip-${{ hashFiles('pyproject.toml') }}
34+
pip-
35+
36+
- name: Install package with dependencies
37+
run: |
38+
pip install -e '.[dev]'
39+
pip install codecov
40+
41+
- name: Generate PLY lextab and parsetab artifacts
42+
run: python -c "import neuxml.xpath.core"
43+
44+
- name: Run pytest
45+
run: pytest --cov=neuxml --cov-report=xml
46+
47+
- name: Upload coverage reports to Codecov
48+
uses: codecov/codecov-action@v5
49+
with:
50+
token: ${{ secrets.CODECOV_TOKEN }}
51+
slug: Princeton-CDH/neuxml

.travis.yml

Lines changed: 0 additions & 16 deletions
This file was deleted.

DEVNOTES.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ To run all unit tests::
2626
pytest
2727

2828
# for continuous integration
29-
pytest --cov=./ --cov-report=xml
29+
pytest --cov=neuxml --cov-report=xml
3030

3131
To run unit tests for a specific module, use syntax like this::
3232

MIGRATION.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Migration from ``eulxml``
44
A convenience script called ``migrate-eulxml`` has been included in order
55
to migrate your project from ``eulxml`` to ``neuxml``, which will replace
66
any usage of the package name in all ``.py`` files in the passed directory
7-
and subdirectories. After upgrading to Python 3.12+ and installing the
7+
and subdirectories. After upgrading to Python 3.10+ and installing the
88
updated package, you can run the script::
99

1010
migrate-eulxml /path/to/your/project

doc/conf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
# 'logo': 'logo.png',
2323
"github_user": "Princeton-CDH",
2424
"github_repo": "neuxml",
25-
# 'travis_button': True, # enable when we get travis-ci set up
2625
"description": "Python library to read and write structured XML",
2726
# 'analytics_id':
2827
}

pyproject.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ description = "XPath-based XML data binding"
88
authors = [
99
{ name = "Center for Digital Humanities at Princeton", email = "cdhdevteam@princeton.edu" },
1010
]
11-
requires-python = ">=3.12"
11+
requires-python = ">=3.10"
1212
readme = "README.rst"
1313
license = { text = "Apache-2" }
1414
dynamic = ["version"]
@@ -19,7 +19,10 @@ classifiers = [
1919
"Natural Language :: English",
2020
"Operating System :: OS Independent",
2121
"Programming Language :: Python",
22+
"Programming Language :: Python :: 3.10",
23+
"Programming Language :: Python :: 3.11",
2224
"Programming Language :: Python :: 3.12",
25+
"Programming Language :: Python :: 3.13",
2326
"Topic :: Software Development :: Libraries :: Python Modules",
2427
"Topic :: Text Processing :: Markup :: XML",
2528
]
@@ -32,7 +35,6 @@ dev = [
3235
"pytest>=4.6",
3336
"pytest-cov",
3437
"pytest-socket",
35-
"tox",
3638
"requests",
3739
"pre-commit",
3840
]

pytest.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[pytest]
2-
python_files = "test/**/*.py"
2+
python_files = "test/**.py"

test/fixtures/mods-3-4.xsd

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)