Skip to content

Commit

Permalink
build: Massive infrastructure update
Browse files Browse the repository at this point in the history
- Move source code into `src/` directory
- Bump pre-commit hooks
- Update GitHub actions
- Allow to install attrs 20.1.0 in dependent projects
- Setup dependabot
- Setup read the docs config
- Update Makefile targets
- Upgrade to latest pytest & move pytest config into `pyproject.toml`
  • Loading branch information
playpauseandstop committed Sep 4, 2020
1 parent 83bf403 commit 8841aa2
Show file tree
Hide file tree
Showing 41 changed files with 734 additions and 258 deletions.
6 changes: 5 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ indent_size = 2
[*.{elm,nginx,py,rst,sh}]
indent_size = 4

[Makefile]
[*Makefile*]
indent_style = tab
tab_width = 4

[*.mk]
indent_style = tab
tab_width = 4
16 changes: 16 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: 2
updates:
- package-ecosystem: pip
directory: "/"
schedule:
interval: monthly
time: "03:00"
open-pull-requests-limit: 10
reviewers:
- playpauseandstop
assignees:
- playpauseandstop
labels:
- build
allow:
- dependency-type: direct
42 changes: 20 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
defaults:
run:
shell: "bash"

name: "ci"

on:
Expand All @@ -8,12 +12,12 @@ on:
branches: ["master"]

env:
COVERALLS_VERSION: "2.1.1"
COVERALLS_VERSION: "2.1.2"
DEV_PYTHON_VERSION: "3.8"
POETRY_VERSION: "1.0.9"
POETRY_VERSION: "1.0.10"
TOX_GH_ACTIONS_VERSION: "1.3.0"
TOX_VERSION: "3.17.1"
TWINE_VERSION: "3.1.1"
TOX_VERSION: "3.20.0"
TWINE_VERSION: "3.2.0"

jobs:
dev:
Expand All @@ -26,10 +30,10 @@ jobs:
runs-on: "${{ matrix.os }}"

steps:
- uses: "actions/[email protected].1"
- uses: "actions/[email protected].2"

- name: "Install Python"
uses: "actions/[email protected].1"
uses: "actions/[email protected].2"
with:
python-version: "${{ env.DEV_PYTHON_VERSION }}"

Expand All @@ -55,16 +59,16 @@ jobs:

services:
redis:
image: "redis:6.0.5-alpine"
image: "redis:6.0.7-alpine"
ports:
- "6379/tcp"
options: "--entrypoint redis-server"

steps:
- uses: "actions/[email protected].1"
- uses: "actions/[email protected].2"

- name: "Install Python"
uses: "actions/[email protected].1"
uses: "actions/[email protected].2"
with:
python-version: "${{ matrix.python-version }}"

Expand All @@ -75,20 +79,14 @@ jobs:

- name: "Install package"
run: |
set -e
poetry install --no-dev
python -m pip install tox==${{ env.TOX_VERSION }} tox-gh-actions==${{ env.TOX_GH_ACTIONS_VERSION }}
- name: "Install depencencies"
run: |
sudo apt install -y locales-all
- name: "Cache pre-commit"
if: "matrix.python-version == env.DEV_PYTHON_VERSION"
uses: "actions/[email protected]"
with:
path: "~/.cache/pre-commit"
key: "pre-commit-${{ matrix.python-version }}-${{ hashFiles('.pre-commit-config.yaml') }}"

- name: "Run pre-commit"
if: "matrix.python-version == env.DEV_PYTHON_VERSION"
uses: "pre-commit/[email protected]"
Expand All @@ -108,10 +106,10 @@ jobs:
REDIS_URL: "redis://localhost:${{ job.services.redis.ports[6379] }}/0"
run: "python -m tox"

- name: "Run tests with openapi-core 0.13.3"
- name: "Run tests with attrs 19.3.0 & openapi-core 0.13.3"
if: "matrix.python-version == env.DEV_PYTHON_VERSION"
env:
TOXENV: "py38-oc0133"
TOXENV: "py38-prev"
PYTEST_ADDOPTS: "--no-cov"
REDIS_URL: "redis://localhost:${{ job.services.redis.ports[6379] }}/0"
run: "python -m tox"
Expand All @@ -131,10 +129,10 @@ jobs:
runs-on: "ubuntu-latest"

steps:
- uses: "actions/[email protected].1"
- uses: "actions/[email protected].2"

- name: "Install Python"
uses: "actions/[email protected].1"
uses: "actions/[email protected].2"
with:
python-version: "${{ env.DEV_PYTHON_VERSION }}"

Expand Down Expand Up @@ -164,7 +162,7 @@ jobs:
runs-on: "ubuntu-latest"

steps:
- uses: "actions/[email protected].1"
- uses: "actions/[email protected].2"

- name: "Fetch git data"
run: |
Expand Down Expand Up @@ -198,7 +196,7 @@ jobs:
echo "::set-output name=prerelease::${prerelease}"
- name: "Create new release"
uses: "actions/[email protected].2"
uses: "actions/[email protected].3"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
with:
Expand Down
150 changes: 143 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,150 @@
*.egg*
*.py[co]

.coverage
.install
# Created by https://www.toptal.com/developers/gitignore/api/python
# Edit at https://www.toptal.com/developers/gitignore?templates=python

.*cache/
### Python ###
# 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
# Do not ignore pyenv local version
#.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/
.tox/
.venv/
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/

# End of https://www.toptal.com/developers/gitignore/api/python

# DotENV files
.env.*
!.env.test

# Makefile target
.install*

# Sublime Text 3 workspace
*.sublime-workspace
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
minimum_pre_commit_version: "1.17.0"
repos:
- repo: "https://github.com/commitizen-tools/commitizen"
rev: "v1.23.0"
rev: "v2.2.0"
hooks:
- id: "commitizen"
language_version: "python3.8"
stages: ["commit-msg"]

- repo: "https://github.com/psf/black"
rev: "19.10b0"
rev: "20.8b1"
hooks:
- id: "black"
name: "Format code (black)"
language_version: "python3.8"
exclude: ^docs/.*$

- repo: "https://github.com/asottile/blacken-docs"
rev: "v1.7.0"
rev: "v1.8.0"
hooks:
- id: "blacken-docs"
name: "Format docs (blacken-docs)"
language_version: "python3.8"
args: ["-l", "64"]
additional_dependencies:
- "black==19.10b0"
- "black==20.8b1"

- repo: "https://github.com/pre-commit/pre-commit-hooks"
rev: "v3.1.0"
rev: "v3.2.0"
hooks:
- id: "end-of-file-fixer"
- id: "trailing-whitespace"
Expand Down
10 changes: 10 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2

sphinx:
configuration: "docs/conf.py"

python:
version: "3.8"
install:
- requirements: "docs/requirements.txt"
- requirements: "docs/requirements-sphinx.txt"
Loading

0 comments on commit 8841aa2

Please sign in to comment.