Skip to content

Commit 7058ffb

Browse files
first commit
1 parent 95fc8d4 commit 7058ffb

26 files changed

Lines changed: 1431 additions & 0 deletions

.flake8

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[flake8]
2+
exclude = __pycache__,built,build,venv
3+
ignore = E203, E266, W503
4+
max-line-length = 88
5+
max-complexity = 18
6+
select = B,C,E,F,W,T4,B9

.github/FUNDING.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# These are supported funding model platforms
2+
3+
github: RobertoPrevato

.github/workflows/build.yml

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
name: Build
2+
3+
on:
4+
release:
5+
types: [published]
6+
push:
7+
branches:
8+
- main
9+
- ci
10+
pull_request:
11+
branches:
12+
- "*"
13+
14+
env:
15+
PROJECT_NAME: configuration
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-18.04
20+
strategy:
21+
matrix:
22+
python-version: [3.6, 3.7, 3.8, 3.9]
23+
24+
steps:
25+
- uses: actions/checkout@v1
26+
with:
27+
fetch-depth: 9
28+
submodules: false
29+
30+
- name: Use Python ${{ matrix.python-version }}
31+
uses: actions/setup-python@v1
32+
with:
33+
python-version: ${{ matrix.python-version }}
34+
35+
- uses: actions/cache@v1
36+
id: depcache
37+
with:
38+
path: deps
39+
key: requirements-pip-${{ matrix.python-version }}-${{ hashFiles('requirements.txt') }}
40+
41+
- name: Download dependencies
42+
if: steps.depcache.outputs.cache-hit != 'true'
43+
run: |
44+
pip download --dest=deps -r requirements.txt
45+
46+
- name: Install dependencies
47+
run: |
48+
pip install -U --no-index --find-links=deps deps/*
49+
50+
- name: Run tests
51+
run: |
52+
pytest --doctest-modules --junitxml=junit/pytest-results-${{ matrix.python-version }}.xml --cov=$PROJECT_NAME --cov-report=xml tests/
53+
54+
- name: Run linters
55+
run: |
56+
echo "Running linters"
57+
58+
flake8 .
59+
isort --check-only . 2>&1
60+
black --check . 2>&1
61+
62+
- name: Upload pytest test results
63+
uses: actions/upload-artifact@master
64+
with:
65+
name: pytest-results-${{ matrix.python-version }}
66+
path: junit/pytest-results-${{ matrix.python-version }}.xml
67+
if: always()
68+
69+
- name: Codecov
70+
run: |
71+
bash <(curl -s https://codecov.io/bash)
72+
73+
- name: Install distribution dependencies
74+
run: pip install --upgrade twine setuptools wheel
75+
if: matrix.python-version == 3.8 || matrix.python-version == 3.9
76+
77+
- name: Create distribution package
78+
run: python setup.py sdist bdist_wheel
79+
if: matrix.python-version == 3.8 || matrix.python-version == 3.9
80+
81+
- name: Upload distribution package
82+
uses: actions/upload-artifact@master
83+
with:
84+
name: dist-package-${{ matrix.python-version }}
85+
path: dist
86+
if: matrix.python-version == 3.8 || matrix.python-version == 3.9
87+
88+
publish:
89+
runs-on: ubuntu-18.04
90+
needs: build
91+
if: github.event_name == 'release'
92+
steps:
93+
- name: Download a distribution artifact
94+
uses: actions/download-artifact@v2
95+
with:
96+
name: dist-package-3.9
97+
path: dist
98+
- name: Publish distribution 📦 to Test PyPI
99+
uses: pypa/gh-action-pypi-publish@master
100+
with:
101+
skip_existing: true
102+
user: __token__
103+
password: ${{ secrets.test_pypi_password }}
104+
repository_url: https://test.pypi.org/legacy/
105+
- name: Publish distribution 📦 to PyPI
106+
uses: pypa/gh-action-pypi-publish@master
107+
with:
108+
user: __token__
109+
password: ${{ secrets.pypi_password }}

.gitignore

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
*.egg-info/
24+
.installed.cfg
25+
*.egg
26+
MANIFEST
27+
28+
# PyInstaller
29+
# Usually these files are written by a python script from a template
30+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
31+
*.manifest
32+
*.spec
33+
34+
# Installer logs
35+
pip-log.txt
36+
pip-delete-this-directory.txt
37+
38+
# Unit test / coverage reports
39+
htmlcov/
40+
.tox/
41+
.coverage
42+
.coverage.*
43+
.cache
44+
nosetests.xml
45+
coverage.xml
46+
*.cover
47+
.hypothesis/
48+
.pytest_cache/
49+
50+
# Translations
51+
*.mo
52+
*.pot
53+
54+
# Django stuff:
55+
*.log
56+
local_settings.py
57+
db.sqlite3
58+
59+
# Flask stuff:
60+
instance/
61+
.webassets-cache
62+
63+
# Scrapy stuff:
64+
.scrapy
65+
66+
# Sphinx documentation
67+
docs/_build/
68+
69+
# PyBuilder
70+
target/
71+
72+
# Jupyter Notebook
73+
.ipynb_checkpoints
74+
75+
# pyenv
76+
.python-version
77+
78+
# celery beat schedule file
79+
celerybeat-schedule
80+
81+
# SageMath parsed files
82+
*.sage.py
83+
84+
# Environments
85+
.env
86+
.venv
87+
env/
88+
venv/
89+
ENV/
90+
env.bak/
91+
venv.bak/
92+
93+
# Spyder project settings
94+
.spyderproject
95+
.spyproject
96+
97+
# Rope project settings
98+
.ropeproject
99+
100+
# mkdocs documentation
101+
/site
102+
103+
# mypy
104+
.mypy_cache/
105+
106+
.idea/
107+
108+
test-cov.xml
109+
test-output.xml
110+
*.py,cover

.isort.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[settings]
2+
profile = black
3+
multi_line_output = 3

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [1.0.0] - 2021-08-09 :cactus:
9+
- Forks new project from [roconfiguration](https://github.com/Neoteroi/roconfiguration), with name `essentials-configuration`
10+
- New code API to support extensions
11+
- Applies `isort` and enforces `isort` and `black` checks in CI pipeline

MANIFEST.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
include README.md
2+
include LICENSE

Makefile

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
.PHONY: release test
2+
3+
4+
artifacts: test
5+
python setup.py sdist bdist_wheel
6+
7+
8+
release: test
9+
python setup.py sdist upload
10+
11+
12+
test:
13+
pytest
14+
15+
16+
testcov:
17+
pytest --cov-report html --cov=configuration tests/
18+
19+
20+
lint: check-flake8 check-isort check-black
21+
22+
23+
check-flake8:
24+
@echo "$(BOLD)Checking flake8$(RESET)"
25+
@flake8 . 2>&1
26+
27+
28+
check-isort:
29+
@echo "$(BOLD)Checking isort$(RESET)"
30+
@isort --check-only . 2>&1
31+
32+
33+
check-black:
34+
@echo "$(BOLD)Checking black$(RESET)"
35+
@black --check . 2>&1
36+
37+
38+
format:
39+
@echo "$(BOLD)Formatting code 🧹 🧼$(RESET)"
40+
@black . 2>&1
41+
@isort . 2>&1

0 commit comments

Comments
 (0)