-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
121 additions
and
208 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[flake8] | ||
extend-ignore = | ||
E501 | ||
extend-exclude = | ||
docs |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Lint | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.x | ||
|
||
- name: Install dependencies | ||
run: pip install pre-commit | ||
|
||
- name: Run pre-commit | ||
run: pre-commit run --all-files --show-diff-on-failure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
name: Release please | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
name: release-please | ||
branches: [main] | ||
|
||
jobs: | ||
release-please: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: "Close stale issues" | ||
name: Close stale issues | ||
|
||
on: | ||
schedule: | ||
|
26 changes: 14 additions & 12 deletions
26
.github/workflows/unit_test.yml → .github/workflows/test.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,30 @@ | ||
name: Unit Tests | ||
name: Test | ||
|
||
on: [push, pull_request] | ||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
build: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] | ||
|
||
name: Python ${{ matrix.python-version }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
architecture: x64 | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements/test.txt | ||
pip install tox tox-gh-actions | ||
sudo apt install build-essential | ||
- name: Test with tox | ||
run: pip install tox tox-gh-actions | ||
|
||
- name: Run tox | ||
run: tox | ||
env: | ||
PLATFORM: ${{ matrix.platform }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,29 @@ | ||
stages: | ||
- test | ||
|
||
.tests_template: &tests_template | ||
before_script: | ||
- pip install tox | ||
- apk add build-base git | ||
stage: test | ||
script: tox | ||
default: | ||
tags: | ||
- hc-bladerunner | ||
|
||
python37: | ||
<<: *tests_template | ||
image: python:3.7-alpine | ||
script: tox -e py37 | ||
stages: | ||
- test | ||
|
||
python38: | ||
<<: *tests_template | ||
image: python:3.8-alpine | ||
script: tox -e py38 | ||
pre-commit: | ||
stage: test | ||
|
||
python39: | ||
<<: *tests_template | ||
image: python:3.9-alpine | ||
script: tox -e py39 | ||
image: python:3.11-alpine | ||
before_script: | ||
- apk add build-base git | ||
- pip install pre-commit | ||
script: | ||
- pre-commit run --all-files --show-diff-on-failure | ||
|
||
python310: | ||
<<: *tests_template | ||
image: python:3.10-alpine | ||
script: tox -e py310 | ||
test: | ||
stage: test | ||
|
||
python311: | ||
<<: *tests_template | ||
image: python:3.11-alpine | ||
script: tox -e py311 | ||
parallel: | ||
matrix: | ||
- python_version: ["3.7", "3.8", "3.9", "3.10", "3.11"] | ||
|
||
test-style: | ||
<<: *tests_template | ||
image: python:3.9-alpine | ||
image: python:${python_version}-alpine | ||
before_script: | ||
- pip install tox | ||
script: | ||
- tox -e pre-commit | ||
- tox -e ${python_version} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,85 +1,23 @@ | ||
.PHONY: clean clean-test clean-pyc clean-build docs help | ||
.DEFAULT_GOAL := help | ||
SHELL := bash | ||
.PHONY: test coverage docs clean | ||
|
||
define BROWSER_PYSCRIPT | ||
import os, webbrowser, sys | ||
venv: | ||
python3 -m venv venv | ||
venv/bin/pip install -e .[docs,test] | ||
|
||
try: | ||
from urllib import pathname2url | ||
except: | ||
from urllib.request import pathname2url | ||
test: venv | ||
venv/bin/pytest -v | ||
|
||
webbrowser.open("file://" + pathname2url(os.path.abspath(sys.argv[1]))) | ||
endef | ||
export BROWSER_PYSCRIPT | ||
coverage: venv | ||
venv/bin/coverage run -m pytest -v | ||
venv/bin/coverage report --show-missing | ||
venv/bin/coverage html | ||
xdg-open htmlcov/index.html | ||
|
||
define PRINT_HELP_PYSCRIPT | ||
import re, sys | ||
|
||
for line in sys.stdin: | ||
match = re.match(r'^([a-zA-Z_-]+):.*?## (.*)$$', line) | ||
if match: | ||
target, help = match.groups() | ||
print("%-20s %s" % (target, help)) | ||
endef | ||
export PRINT_HELP_PYSCRIPT | ||
|
||
BROWSER := python -c "$$BROWSER_PYSCRIPT" | ||
|
||
help: | ||
@python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST) | ||
|
||
clean: clean-build clean-pyc clean-test ## remove all build, test, coverage and Python artifacts | ||
|
||
clean-build: ## remove build artifacts | ||
rm -fr build/ | ||
rm -fr dist/ | ||
rm -fr .eggs/ | ||
find . -name '*.egg-info' -exec rm -fr {} + | ||
find . -name '*.egg' -exec rm -f {} + | ||
|
||
clean-pyc: ## remove Python file artifacts | ||
find . -name '*.pyc' -exec rm -f {} + | ||
find . -name '*.pyo' -exec rm -f {} + | ||
find . -name '*~' -exec rm -f {} + | ||
find . -name '__pycache__' -exec rm -fr {} + | ||
|
||
clean-test: ## remove test and coverage artifacts | ||
rm -fr .tox/ | ||
rm -f .coverage | ||
rm -fr htmlcov/ | ||
rm -fr .pytest_cache | ||
|
||
lint: ## check code with pre-commit | ||
tox -e pre-commit | ||
|
||
test: ## run tests quickly with the default Python | ||
py.test | ||
|
||
test-all: ## run tests on every Python version with tox | ||
tox | ||
|
||
coverage: ## check code coverage quickly with the default Python | ||
coverage run --source hcloud -m pytest | ||
coverage report -m | ||
coverage html | ||
$(BROWSER) htmlcov/index.html | ||
|
||
docs: ## generate Sphinx HTML documentation, including API docs | ||
docs: | ||
$(MAKE) -C docs clean | ||
$(MAKE) -C docs html | ||
$(BROWSER) docs/_build/html/index.html | ||
|
||
servedocs: docs ## compile the docs watching for changes | ||
watchmedo shell-command -p '*.rst' -c '$(MAKE) -C docs html' -R -D . | ||
|
||
release: dist ## package and upload a release | ||
twine upload dist/* | ||
|
||
dist: clean ## builds source and wheel package | ||
python setup.py sdist | ||
python setup.py bdist_wheel | ||
ls -l dist | ||
xdg-open docs/_build/html/index.html | ||
|
||
install: clean ## install the package to the active Python's site-packages | ||
python setup.py install | ||
clean: | ||
git clean -xdf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,10 @@ | ||
[tool.isort] | ||
profile = "black" | ||
combine_as_imports = true | ||
|
||
[tool.coverage.run] | ||
source = ["hcloud"] | ||
|
||
[build-system] | ||
requires = ["setuptools", "wheel"] | ||
build-backend = "setuptools.build_meta" |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.