Skip to content

Commit dcb06b0

Browse files
authored
Cleanup Extension Structure (#12)
1 parent c6cd797 commit dcb06b0

11 files changed

Lines changed: 251 additions & 148 deletions

File tree

.github/workflows/workflow.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,33 @@
1-
name: Test and Deploy
1+
name: CI
22
on:
33
push:
44
branches:
55
- main
6+
pull_request:
7+
branches:
8+
- main
69
create:
710
tags:
811
- '*'
912
jobs:
13+
check:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v2
17+
- uses: actions/setup-python@v2
18+
with:
19+
python-version: 3.8
20+
- name: Black
21+
run: |
22+
pip install black
23+
black --check --exclude /docs --diff .
1024
test-extension:
1125
runs-on: ubuntu-latest
1226
strategy:
1327
matrix:
14-
python-version: ['3.6', '3.7', '3.8', 'pypy3']
28+
python-version: ['3.6', '3.7', '3.8', '3.9', 'pypy3']
29+
sphinx-version: ['2', '3']
30+
name: "Test Extension - Python(${{ matrix.python-version }}), Sphinx(${{ matrix.sphinx-version }})"
1531
steps:
1632
- uses: actions/checkout@v2
1733
- name: Setup Python
@@ -25,6 +41,7 @@ jobs:
2541
python -m site
2642
python -m pip install --upgrade pip setuptools wheel
2743
python -m pip install -r dev-requirements.txt
44+
python -m pip install sphinx==${{ matrix.sphinx-version }}
2845
- name: Run Tests for ${{ matrix.python-version }}
2946
run: |
3047
python -m pytest -vv

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
11
# sphinxext-remoteliteralinclude
2+
3+
![CI](https://github.com/wpilibsuite/sphinxext-remoteliteralinclude/workflows/CI/badge.svg)
4+
25
Sphinx extension that extends the ``literalinclude`` directive to allow remote URLS
36

47
## Installation
58

9+
Please install the extension via pip using the following command:
10+
611
``python3 -m pip install sphinxext-remoteliteralinclude``
712

13+
then in your ``conf.py`` under ``extensions``, it should look like the following:
14+
15+
```python
16+
extensions = ["sphinxext.remoteliteralinclude"]
17+
```
18+
819
## Usage
920

1021
Simply just use it as you normally would a normal ``literalinclude``

dev-requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
sphinx
2+
six
23
pytest==5.4.3
34
wheel==0.34.2

setup.py

Lines changed: 31 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
import setuptools
22
import subprocess
33

4-
ret = subprocess.run("git describe --tags --abbrev=0", stdout=subprocess.PIPE,
5-
stderr=subprocess.PIPE, check=True, shell=True)
6-
version = ret.stdout.decode("utf-8").strip()
4+
try:
5+
ret = subprocess.run(
6+
"git describe --tags --abbrev=0",
7+
stdout=subprocess.PIPE,
8+
stderr=subprocess.PIPE,
9+
check=True,
10+
shell=True,
11+
)
12+
version = ret.stdout.decode("utf-8").strip()
13+
except:
14+
version = "main"
715

816

917
with open("README.md", "r", encoding="utf-8") as fh:
@@ -18,26 +26,26 @@
1826
long_description=long_description,
1927
long_description_content_type="text/markdown",
2028
url="https://github.com/wpilibsuite/sphinxext-remoteliteralinclude",
21-
install_requires = ['sphinx>=2.0'],
22-
packages=['sphinxext'],
29+
install_requires=["sphinx>=2.0", "six"],
30+
packages=["sphinxext"],
2331
classifiers=[
24-
'Development Status :: 5 - Production/Stable',
25-
'Environment :: Plugins',
26-
'Environment :: Web Environment',
27-
'Framework :: Sphinx :: Extension',
28-
'Intended Audience :: Developers',
29-
'License :: OSI Approved :: MIT License',
30-
'Natural Language :: English',
31-
'Operating System :: OS Independent',
32-
'Programming Language :: Python :: 3.6',
33-
'Programming Language :: Python :: 3.7',
34-
'Programming Language :: Python :: 3.8',
35-
'Programming Language :: Python',
36-
'Topic :: Documentation :: Sphinx',
37-
'Topic :: Documentation',
38-
'Topic :: Software Development :: Documentation',
39-
'Topic :: Text Processing',
40-
'Topic :: Utilities',
32+
"Development Status :: 5 - Production/Stable",
33+
"Environment :: Plugins",
34+
"Environment :: Web Environment",
35+
"Framework :: Sphinx :: Extension",
36+
"Intended Audience :: Developers",
37+
"License :: OSI Approved :: MIT License",
38+
"Natural Language :: English",
39+
"Operating System :: OS Independent",
40+
"Programming Language :: Python :: 3.6",
41+
"Programming Language :: Python :: 3.7",
42+
"Programming Language :: Python :: 3.8",
43+
"Programming Language :: Python",
44+
"Topic :: Documentation :: Sphinx",
45+
"Topic :: Documentation",
46+
"Topic :: Software Development :: Documentation",
47+
"Topic :: Text Processing",
48+
"Topic :: Utilities",
4149
],
42-
python_requires='>=3.4',
50+
python_requires=">=3.4",
4351
)

0 commit comments

Comments
 (0)