Skip to content

Commit

Permalink
build: Switch to pyproject.toml. Use coverage directly, instead of py…
Browse files Browse the repository at this point in the history
…test-cov. ci: Use official coveralls action. Add pre-commit job to automerge workflow.
jpmckinney committed Sep 7, 2024
1 parent 3534c63 commit c44df3d
Showing 4 changed files with 58 additions and 55 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
@@ -23,3 +23,13 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh pr merge --auto --squash ${{ github.event.pull_request.html_url }}
precommit:
if: ${{ github.event.pull_request.user.login == 'pre-commit-ci[bot]' }}
runs-on: ubuntu-latest
steps:
- env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh pr review --approve ${{ github.event.pull_request.html_url }}
- env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh pr merge --auto --squash ${{ github.event.pull_request.html_url }}
12 changes: 5 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -7,21 +7,19 @@ jobs:
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
python-version: [3.8, 3.9, '3.10', '3.11', '3.12', pypy-3.9]
python-version: [3.8, 3.9, '3.10', '3.11', '3.12', pypy-3.10]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: setup.cfg
- if: matrix.os == 'ubuntu-latest' && matrix.python-version == 'pypy-3.9'
- if: matrix.os == 'ubuntu-latest' && matrix.python-version == 'pypy-3.10'
run: |
sudo apt update
sudo apt install libxml2-dev libxslt-dev
- run: pip install .[test]
# MyST-Parser > 2.0.0 https://github.com/executablebooks/MyST-Parser/issues/612
- run: pytest -W error -W ignore::DeprecationWarning --cov sphinxcontrib.opencontracting
- env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: coveralls --service=github
# MyST-Parser 3+ requires Sphinx 6+ https://github.com/executablebooks/MyST-Parser/issues/612
- run: coverage run --source=sphinxcontrib.opencontracting -m pytest -W error -W ignore::DeprecationWarning
- uses: coverallsapp/github-action@v2
43 changes: 43 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,46 @@
[build-system]
requires = ["setuptools>=61.2"]
build-backend = "setuptools.build_meta"

[project]
name = "sphinxcontrib-opencontracting"
version = "0.0.9"
authors = [{name = "Open Contracting Partnership", email = "data@open-contracting.org"}]
description = "Provides Sphinx directives for the documentation of the Open Contracting Data Standard"
readme = "README.rst"
license = {text = "BSD"}
urls = {Homepage = "https://github.com/open-contracting/sphinxcontrib-opencontracting"}
classifiers = [
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Framework :: Sphinx :: Extension",
]
dependencies = [
"docutils",
"jsonpointer",
"MyST-Parser",
"requests",
"ocdsextensionregistry>=0.0.8",
"sphinx",
]

[project.optional-dependencies]
test = [
"coverage",
"lxml",
"pytest",
"sphinx>=4.4.0",
]

[tool.setuptools.packages.find]
exclude = [
"tests",
"tests.*",
]
48 changes: 0 additions & 48 deletions setup.cfg

This file was deleted.

0 comments on commit c44df3d

Please sign in to comment.