Skip to content

Commit 2b549c5

Browse files
authored
convert docs to markdown; add github action (#31)
* convert docs to markdown; add github action * drop python 2.7, adjust pypy version * adjust pyproject build backend settings
1 parent 4bd5b80 commit 2b549c5

File tree

8 files changed

+85
-27
lines changed

8 files changed

+85
-27
lines changed

.github/workflows/sphinx.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Sphinx
2+
on:
3+
- push
4+
- pull_request
5+
6+
jobs:
7+
sphinx:
8+
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v3
13+
- uses: actions/setup-python@v4
14+
with:
15+
python-version: "3.x"
16+
architecture: "x64"
17+
cache: "pip"
18+
- name: Build Documentation
19+
run: |
20+
pip install .[docs]
21+
cd docs
22+
make html
23+
- name: Upload artifact
24+
uses: actions/upload-pages-artifact@v1
25+
with:
26+
# Upload entire repository
27+
path: 'build/html'
28+
29+
pages:
30+
31+
runs-on: ubuntu-latest
32+
if: github.ref == 'refs/heads/main'
33+
needs: [sphinx]
34+
35+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
36+
permissions:
37+
contents: read
38+
pages: write
39+
id-token: write
40+
41+
environment:
42+
name: github-pages
43+
url: ${{ steps.deployment.outputs.page_url }}
44+
45+
steps:
46+
- name: Deploy to GitHub Pages
47+
id: deployment
48+
uses: actions/deploy-pages@v1

.github/workflows/upload-pypi-source.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ jobs:
77
runs-on: ubuntu-latest
88
strategy:
99
matrix:
10-
python-version: [2.7, 3.7, 3.8, 3.9, pypy2, pypy3]
10+
python-version: ["3.8", "3.9", "3.10", pypy3.9]
1111

1212
steps:
13-
- uses: actions/checkout@v2
13+
- uses: actions/checkout@v3
1414
- name: Set up Python ${{ matrix.python-version }}
15-
uses: actions/setup-python@v2
15+
uses: actions/setup-python@v4
1616
with:
1717
python-version: ${{ matrix.python-version }}
1818
# You can test your matrix by printing the current Python version
@@ -24,7 +24,7 @@ jobs:
2424
scons -c
2525
scons
2626
python -m pip install dist/enscons*.whl
27-
27+
2828
# - name: Upload artifacts
2929
# uses: actions/upload-artifact@v1
3030
# with:

docs/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
SPHINXOPTS =
66
SPHINXBUILD = sphinx-build
77
PAPER =
8-
BUILDDIR = _build
8+
BUILDDIR = ../build
99

1010
# Internal variables.
1111
PAPEROPT_a4 = -D latex_paper_size=a4

docs/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
# ones.
3232
extensions = [
3333
'sphinx.ext.autodoc',
34+
'myst_parser',
3435
]
3536

3637
# Add any paths that contain templates here, relative to this directory.

docs/index.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
% enscons documentation master file, created by
2+
% sphinx-quickstart on Fri Jul 1 19:56:09 2016.
3+
% You can adapt this file completely to your liking, but it should at least
4+
% contain the root `toctree` directive.
5+
6+
```{eval-rst}
7+
.. include:: ../README.rst
8+
```
9+
10+
```{toctree}
11+
:maxdepth: 2
12+
```
13+
14+
# Indices and tables
15+
16+
- {ref}`genindex`
17+
- {ref}`modindex`
18+
- {ref}`search`

docs/index.rst

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

docs/requirements.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# docs
2+
furo
3+
sphinx
4+
myst-parser
5+
mdit-py-plugins>=0.3.0

pyproject.toml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ name = "enscons"
33
description = "Tools for building Python packages with SCons"
44
version = "0.28.0"
55

6-
authors = [
7-
{name = "Daniel Holth", email = "[email protected]"}
8-
]
6+
authors = [{ name = "Daniel Holth", email = "[email protected]" }]
97
classifiers = [
108
"Programming Language :: Python :: 2.7",
119
"Programming Language :: Python :: 3",
@@ -28,11 +26,16 @@ url = "https://github.com/dholth/enscons"
2826

2927
[project.optional-dependencies]
3028
cli = ["click"]
31-
doc = ["sphinx"]
29+
docs = ["furo", "sphinx", "myst-parser", "mdit-py-plugins>=0.3.0"]
3230

3331
[project.scripts]
3432
setup2toml = "enscons.setup2toml:main"
3533

3634
[build-system]
3735
build-backend = "enscons.api"
38-
requires = ["pytoml>=0.1"] # enscons users add "enscons>=0.28" to this list
36+
backend-path = ["."] # only for bootstrapped enscons
37+
requires = [
38+
"scons",
39+
"packaging",
40+
"pytoml>=0.1",
41+
] # enscons users add "enscons>=0.28" to this list

0 commit comments

Comments
 (0)