Skip to content

Commit

Permalink
Build the docs as a part of the test suite
Browse files Browse the repository at this point in the history
The docs can be built standalone using:

```
tox -e docs
```

This also eliminates two scripts and the Makefile in the `docs/` directory.

The docs can now be uploaded using:

```
make sync-docs
```
  • Loading branch information
kurtmckee authored and LudovicRousseau committed Sep 23, 2024
1 parent 44de165 commit 8ab65fc
Show file tree
Hide file tree
Showing 10 changed files with 62 additions and 408 deletions.
30 changes: 27 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
- name: "Install build prerequisites (macOS)"
if: matrix.name == 'macOS'
run: |
brew install swig pylint
brew install swig
- name: "Install build prerequisites (Windows)"
if: startsWith(matrix.name, 'Windows')
Expand Down Expand Up @@ -105,6 +105,30 @@ jobs:
name: wheel-${{ matrix.name }}-${{ matrix.cpython }}-${{ matrix.architecture }}
path: dist/*.whl

- name: "Lint"

quality:
name: "Quality"
runs-on: "ubuntu-latest"

steps:
- name: "Checkout the repository"
uses: actions/checkout@v4

- name: "Set up Python"
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: "Install build prerequisites"
run: |
sudo apt install libpcsclite-dev python3-all-dev swig
- name: "Create a virtual environment"
run: |
python -m venv temp
temp/bin/python -m pip install --upgrade pip setuptools wheel
temp/bin/pip install tox
- name: "Perform quality checks"
run: |
${{ env.venv-path }}/tox -e pylint
temp/bin/tox -e docs,pylint
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Unreleased changes
* Migrate CI to use the official Coveralls action
* Standardize local and CI testing to use tox
* Build wheels in CI for all supported Python versions
* Build the docs as a part of the test suite

2.1.1 (September 2024)
======================
Expand Down
11 changes: 7 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ pypi: clean
# files generated by swig
rm -f src/smartcard/scard/scard.py
rm -f src/smartcard/scard/scard_wrap.c
# files generated by sphinx
rm -rf src/smartcard/doc/_build
# files generated by pydoctor
rm -rf src/smartcard/doc/html
rm -rf dist
# Use the tox 'build' label to generate wheels for all Python versions.
$(TOX) run -m build
Expand All @@ -34,4 +30,11 @@ coverage:
ChangeLog.git:
git log --stat --decorate=short > $@

.PHONY: sync-docs
sync-docs:
rsync \
--recursive --verbose --update --rsh=ssh --links \
build/docs/ \
ludov@web.sourceforge.net:/home/project-web/pyscard/htdocs/

.PHONY: clean build pypi test
11 changes: 11 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
[build-system]
requires = ["setuptools","swig"]
build-backend = "setuptools.build_meta"


# pydoctor
# --------

[tool.pydoctor]
add-package = ["src/smartcard"]
project-name = "PySCard"
project-url = "https://github.com/LudovicRousseau/pyscard"
html-output = "build/docs/apidocs"
warnings-as-errors = true
153 changes: 0 additions & 153 deletions src/smartcard/doc/Makefile

This file was deleted.

Loading

0 comments on commit 8ab65fc

Please sign in to comment.