Skip to content

Commit

Permalink
v2 🥚
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertoPrevato committed Apr 8, 2023
1 parent 4ada96f commit 9603e04
Show file tree
Hide file tree
Showing 51 changed files with 1,326 additions and 290 deletions.
48 changes: 30 additions & 18 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
- "*"

env:
PROJECT_NAME: configuration
PROJECT_NAME: config

jobs:
build:
Expand Down Expand Up @@ -55,6 +55,7 @@ jobs:
run: |
echo "Running linters"
pip install black
flake8 .
isort --check-only . 2>&1
black --check . 2>&1
Expand All @@ -71,19 +72,19 @@ jobs:
bash <(curl -s https://codecov.io/bash)
- name: Install distribution dependencies
run: pip install --upgrade twine setuptools wheel
if: matrix.python-version == 3.10
run: pip install build
if: matrix.python-version == 3.11

- name: Create distribution package
run: python setup.py sdist bdist_wheel
if: matrix.python-version == 3.10
run: python -m build
if: matrix.python-version == 3.11

- name: Upload distribution package
uses: actions/upload-artifact@master
with:
name: dist-package-${{ matrix.python-version }}
name: dist
path: dist
if: matrix.python-version == 3.10
if: matrix.python-version == 3.11

publish:
runs-on: ubuntu-latest
Expand All @@ -93,17 +94,28 @@ jobs:
- name: Download a distribution artifact
uses: actions/download-artifact@v2
with:
name: dist-package-3.10
name: dist
path: dist
- name: Publish distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@master

- name: Use Python 3.11
uses: actions/setup-python@v1
with:
skip_existing: true
user: __token__
password: ${{ secrets.test_pypi_password }}
repository_url: https://test.pypi.org/legacy/
python-version: '3.11'

- name: Install dependencies
run: |
pip install twine
- name: Publish distribution 📦 to Test PyPI
run: |
twine upload -r testpypi dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.test_pypi_password }}

- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.pypi_password }}
run: |
twine upload -r pypi dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.pypi_password }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,4 @@ venv.bak/
test-cov.xml
test-output.xml
*.py,cover
venv*
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.0.0] - 2023-04-08 :egg:
- Renames the main namespace to `config`.
- Adds a method to obtain type checked configuration items (e.g. with `pydantic`
or custom classes).
- Adds support to read secrets stored in the user folder, for development purpose.
- Adds a CLI to administer local secrets stored in the user folder.
- Adds a `FileConfigurationSource` base class.
- Migrates to `pyproject.toml`.
- Add support for `.env` files bound using `python-dotenv`.

## [1.0.0] - 2022-11-04 :snake:
- Upgrades pinned dependencies for Python 3.11
- Adds the alias "EnvVars" to reduce the verbosity of the class name "EnvironmentVariables"
Expand Down
20 changes: 12 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,35 @@


artifacts: test
python setup.py sdist bdist_wheel
python -m build


clean:
rm -rf dist/


prepforbuild:
pip install --upgrade twine setuptools wheel
pip install build


testrelease:
twine upload --repository-url https://test.pypi.org/legacy/ dist/*
build:
python -m build


release: clean artifacts
twine upload --repository-url https://upload.pypi.org/legacy/ dist/*
test-release:
twine upload --repository testpypi dist/*


release:
twine upload --repository pypi dist/*


test:
pytest


testcov:
pytest --cov-report html --cov=configuration tests/
test-cov:
pytest --cov-report html --cov=config tests/


lint: check-flake8 check-isort check-black
Expand Down
Loading

0 comments on commit 9603e04

Please sign in to comment.