Skip to content

Commit fec30a1

Browse files
committed
Added some actions for CI, page building.
- Fixed the setup to include the missing dependencies. - Switch to getpass to obtain the username. - Improved the aesthetics of the docs.
1 parent f8272ac commit fec30a1

File tree

6 files changed

+89
-5
lines changed

6 files changed

+89
-5
lines changed

.github/workflows/build-docs.yaml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# This workflow will install Python dependencies, run tests and lint with a single version of Python
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3+
4+
name: Build docs
5+
6+
on:
7+
push:
8+
branches:
9+
- master
10+
11+
jobs:
12+
build:
13+
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Set up Python 3.9
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: 3.9
23+
cache: 'pip'
24+
25+
- name: Install dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
pip install flake8 pytest tox
29+
30+
- name: Build docs
31+
run: |
32+
tox -e docs
33+
touch ./docs/_build/html/.nojekyll
34+
35+
- name: GH Pages Deployment
36+
uses: JamesIves/github-pages-deploy-action@v4
37+
with:
38+
branch: gh-pages # The branch the action should deploy to.
39+
folder: ./docs/_build/html
40+
clean: true # Automatically remove deleted files from the deploy branch

.github/workflows/run-tests.yaml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# This workflow will install Python dependencies, run tests and lint with a single version of Python
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3+
4+
name: Test the library
5+
6+
on:
7+
push:
8+
branches: [ master ]
9+
pull_request:
10+
branches: [ master ]
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12' ]
19+
20+
name: Python ${{ matrix.python-version }}
21+
steps:
22+
- uses: actions/checkout@v4
23+
24+
- name: Setup Python
25+
uses: actions/setup-python@v5
26+
with:
27+
python-version: ${{ matrix.python-version }}
28+
cache: 'pip'
29+
30+
- name: Install dependencies
31+
run: |
32+
python -m pip install --upgrade pip
33+
pip install flake8 pytest tox
34+
35+
- name: Test with tox
36+
run: |
37+
tox

docs/conf.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
"sphinx.ext.ifconfig",
7373
"sphinx.ext.mathjax",
7474
"sphinx.ext.napoleon",
75+
"sphinx_autodoc_typehints",
7576
]
7677

7778
# Add any paths that contain templates here, relative to this directory.
@@ -171,7 +172,7 @@
171172

172173
# The theme to use for HTML and HTML Help pages. See the documentation for
173174
# a list of builtin themes.
174-
html_theme = "alabaster"
175+
html_theme = "furo"
175176

176177
# Theme options are theme-specific and customize the look and feel of a theme
177178
# further. For a list of options available for each theme, see the
@@ -301,4 +302,4 @@
301302
"pyscaffold": ("https://pyscaffold.org/en/stable", None),
302303
}
303304

304-
print(f"loading configurations for {project} {version} ...", file=sys.stderr)
305+
print(f"loading configurations for {project} {version} ...", file=sys.stderr)

docs/requirements.txt

+2
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@
44
# sphinx_rtd_theme
55
myst-parser[linkify]
66
sphinx>=3.2.1
7+
furo
8+
sphinx-autodoc-typehints

setup.cfg

+2-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ package_dir =
4949
# For more information, check out https://semver.org/.
5050
install_requires =
5151
importlib-metadata; python_version<"3.8"
52-
52+
requests
53+
appdirs
5354

5455
[options.packages.find]
5556
where = src

src/pygobbler/start_gobbler.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,13 @@ def _initialize_gobbler_process(exe: str, staging: Optional[str], registry: Opti
116116
global test_port
117117
test_port = port
118118

119-
global test_process
119+
import getpass
120+
user = getpass.getuser()
120121

121122
import subprocess
122-
test_process = subprocess.Popen([ exe, "-admin", os.getlogin(), "-registry", registry, "-staging", staging, "-port", str(port) ], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
123+
global test_process
124+
test_process = subprocess.Popen([ exe, "-admin", user, "-registry", registry, "-staging", staging, "-port", str(port) ], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
125+
123126
import atexit
124127
atexit.register(stop_gobbler)
125128
return

0 commit comments

Comments
 (0)