Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modern CI and Python Tooling #206

Merged
merged 39 commits into from
Sep 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
a238075
Use `setup.cfg` for package distribution configuration
althonos Nov 12, 2019
89cd9cd
add tox and github actions
svenevs Feb 11, 2020
e2857e3
rename flake8 => lint (future linting tests)
svenevs Feb 12, 2020
ab8ce52
add linkcheck tests, fix broken links
svenevs Feb 12, 2020
502aae7
{{test}} create packaging workflow, see what it does (we're gonna squ…
svenevs Feb 12, 2020
6a08e41
prevent double builds and [testpypi] deployment (!!!)
svenevs Feb 12, 2020
ea8772c
[testpypi] attempt numbah 2
svenevs Feb 12, 2020
dc99195
debug
svenevs Feb 12, 2020
3049285
debug: improper token password, print more things ? log
svenevs Feb 12, 2020
4ced503
debug: will still fail but should trigger bc [testpypi]
svenevs Feb 12, 2020
f67db95
the commit does not exist?!
svenevs Feb 12, 2020
2bd90cc
debug: it can't actually be _this_ complicated?!! [testpypi]
svenevs Feb 12, 2020
f7533f7
debug: [testpypi] check /head not /merge
svenevs Feb 12, 2020
b4d9b20
debug omfg remove /head [testpypi]
svenevs Feb 12, 2020
c344b90
confirmed ${{ github.event.head_commit.message }} DNE
svenevs Feb 12, 2020
22fffcd
::set-env chokes on multiline commit message (but GITHUB_CONTEXT did …
svenevs Feb 12, 2020
5030d85
debug: could it be that it exists?
svenevs Feb 12, 2020
9cba505
debug: i guess I can't shortcircuit on tag, starting with ! is problem?
svenevs Feb 12, 2020
14c941c
i see, the api is different for push and pull_request
svenevs Feb 13, 2020
3b045dd
use 'pull_request' in single quotes, not "pull_request"
svenevs Feb 13, 2020
c025214
this is honestly pathetic
svenevs Feb 13, 2020
cbb7bdd
it works well enough, remove double builds
svenevs Feb 13, 2020
7522bae
remove [testpypi] stuff
svenevs Feb 27, 2020
86e9c38
add clean helper env, document how to use tox / tests
svenevs Feb 27, 2020
8167755
propose new versioning scheme
svenevs Feb 27, 2020
adf2d46
[clean] need to ignore_errors for shutil.rmtree
svenevs Feb 27, 2020
b26674b
deploy to GitHub Pages on tagged releases
svenevs Feb 27, 2020
87b8d7e
small setup.py cleanup
svenevs Sep 10, 2021
c112180
remove outdated tooling
svenevs Sep 10, 2021
0eb67d2
add directions for how to develop
svenevs Sep 10, 2021
be2d03a
explain how to release things
svenevs Sep 10, 2021
af8e2cf
add explicit link to the Test PyPI site
svenevs Sep 10, 2021
f6256f7
actually do some testing with py / sphinx versions
svenevs Sep 10, 2021
05a666a
tests need changedir = demo
svenevs Sep 10, 2021
13291f6
fix linting paths
svenevs Sep 10, 2021
389ff91
fix homepage URL, if u testpyi upload its on the left
svenevs Sep 10, 2021
663e97e
fix linkcheck errors, set to 0.8.0 for final test
svenevs Sep 11, 2021
afad29a
fixup tox.ini pathing
svenevs Sep 11, 2021
5ce7b5c
actually test tox -e dist to make sure packaging isnt broken in PRs
svenevs Sep 11, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .github/workflows/github_pages.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: GitHub Pages
on:
push:
# Release tags are v*, e.g., v0.8.0 or v1.0.0
tags:
- v*
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: 3.x
- name: Install Tox
run: pip install tox
- name: Build and Deploy Website
run: |
set -exo

# Gather current version number for comit message later.
version="$(python -c 'import sys; sys.path.insert(0, "."); from sphinx_bootstrap_theme import __version__; print(__version__)')"

# Be explicit about --workdir so we know exactly where it is.
tox --workdir ./.tox -e docs
mv .tox/docs/tmp/html/ ..
tox -e clean # remove e.g., __pycache__ and friends
rm -rf .tox
git reset --hard # not necessary but not a problem either

# Get the gh-pages branch with all the previous versions.
git remote -v
git fetch origin gh-pages
git checkout gh-pages

# Delete everything and then re-add it.
git rm -r .
mv ../html/* .
touch .nojekyll
git add -Af .
git --no-pager status
git --no-pager diff --color=always

# Configure and push.
git config --local user.name github-actions
git config --local user.email "[email protected]"
git commit -m "Version $version"
git push https://${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
26 changes: 26 additions & 0 deletions .github/workflows/package.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Package
on:
push:
# Release tags are v*, e.g., v0.8.0 or v1.0.0
tags:
- v*
jobs:
dist:
name: Distribution
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: 3.x
- name: Install Tox
run: pip install tox
- name: Package
run: tox -e dist
- name: Upload to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.pypi_password }}
88 changes: 88 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Tests
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: 3.x
- name: Install Tox
run: pip install tox
- name: Lint
run: tox -e lint
docs:
name: Docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: 3.x
- name: Install Tox
run: pip install tox
- name: Build Docs
run: tox -e docs
dist:
name: Dist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: 3.x
- name: Install Tox
run: pip install tox
- name: Build Dist
run: tox -e dist
linkcheck:
name: Linkcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: 3.x
- name: Install Tox
run: pip install tox
- name: Build Linkcheck
run: tox -e linkcheck
test:
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
python-version: [2.7, 3.5, 3.6, 3.7, 3.8]
name: Py ${{ matrix.python-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install Tox
run: pip install tox
- name: Test Sphinx 1.8.5
env:
SPHINX_VERSION: ==1.8.5
run: tox -e py
- name: Test Sphinx 2.0
env:
SPHINX_VERSION: ==2.0
run: tox -e py
if: matrix.python-version >= 3.5
- name: Test Sphinx Latest
run: tox -e py
if: matrix.python-version >= 3.5
135 changes: 135 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,138 @@ __pycache__
.vscode
Pipfile*

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

21 changes: 0 additions & 21 deletions Makefile

This file was deleted.

Loading