Skip to content

Commit

Permalink
v0.5.x
Browse files Browse the repository at this point in the history
New definition attributes
Support for Keepass and Ansible-vault source formats
Support for auto-generated ANSIBLE_PASSWORD_FILE
New input handling via STDIN and Python-getpass
Better error handling
Improved documentation
Lots and lots of tests
Migrate project to more recent version of slap-cli for appdev management
  • Loading branch information
ndejong committed Sep 21, 2024
1 parent c665e14 commit 4ee2d1b
Show file tree
Hide file tree
Showing 120 changed files with 2,631 additions and 1,905 deletions.
23 changes: 23 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[flake8]
max-line-length = 120

# Black can yield formatted code that triggers these Flake8 warnings.
ignore =

# Line break occurred before a binary operator (W503) - https://www.flake8rules.com/rules/W503.html
W503

# Line break occurred after a binary operator (W504) - https://www.flake8rules.com/rules/W504.html
W504

# E501 line too long (151 > 120 characters) - https://www.flake8rules.com/rules/E501.html
E501

per-file-ignores =

# Module imported but unused (F401) - https://www.flake8rules.com/rules/F401.html
tests/**.py: F401

# W293 blank line contains whitespace - https://www.flake8rules.com/rules/W293.html
# W291 trailing whitespace - https://www.flake8rules.com/rules/W291.html
src/env_alias/main.py: W293, W291
59 changes: 20 additions & 39 deletions .github/workflows/build-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,53 +4,34 @@ on: [push]

jobs:

build:
test:
name: "Test package"
runs-on: ubuntu-latest

strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]

python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- name: Install actions/checkout@v2
uses: actions/checkout@v2

- name: Install actions/setup-python@v2 for ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- uses: actions/checkout@v4
- uses: NiklasRosenstein/slap@gha/install/v1
with: { version: "1.12.0" }

- name: Python version
run: python -c "import sys; print(sys.version)"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade pyyaml
- name: flake8 lint
run: |
python -m pip install --upgrade flake8
# https://flake8.pycqa.org/en/latest/user/error-codes.html
# https://pycodestyle.pycqa.org/en/latest/intro.html#error-codes
flake8 ./src --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 ./src --count --exit-zero --max-complexity=20 --max-line-length=120 --statistics
- name: python setup.py clean build
run: |
python -m pip install --upgrade wheel setuptools
python setup.py clean build
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with: { python-version: "${{ matrix.python-version }}" }

- name: pytest
- name: Create a venv to operate within using slap-cli
run: |
python -m pip install --upgrade pytest
pytest
slap venv --create tester
- name: python setup.py install
- name: Install, test and build a package to install
run: |
python setup.py install
slap release --validate
slap install --use-venv=tester
slap test --use-venv=tester
mkdir build-tester
slap publish --build-directory build-tester --dry
- name: which env-alias
- name: Install the package from whl and run the application
run: |
which env-alias
which env-alias-generator
pip install build-tester/*.whl
env-alias --version
138 changes: 21 additions & 117 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,126 +1,30 @@
# 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
*.py[cod]
*.egg-info
*.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
.hypothesis/
venv*/
.venv*/
.idea/
.pytest_cache/
__pycache__/
.pytest*/

# 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
.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

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

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

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject
dev/
dev.py
samples/
docs/_site

# mkdocs documentation
/site
dist/
build/
packages/

# mypy
.mypy_cache/
/.vscode
/dist
/build
.venv/
*.egg-info/
poetry.lock
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

.idea
profiler.html
18 changes: 0 additions & 18 deletions .pylintrc

This file was deleted.

27 changes: 20 additions & 7 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@

version: 2

mkdocs: {} # tell readthedocs to use mkdocs
mkdocs:
configuration: "docs/mkdocs.yml"

build:
os: ubuntu-22.04
tools:
python: "3.10"
jobs:
pre_build:
- pip install mkdocs-material==9.1.21 # https://pypi.org/project/mkdocs-material/#history
- pip install pydoc-markdown==4.8.2 # https://pypi.org/project/pydoc-markdown/#history
- pip install novella==0.2.6 # https://pypi.org/project/novella/#history
- cd docs && novella --base-url /en/latest/
post_build:
- rm -Rf $READTHEDOCS_OUTPUT/html
- mv docs/_site $READTHEDOCS_OUTPUT/html

python:
version: 3.8
install:
- method: pip
path: .
- requirements: docs/.readthedocs-requirements.txt
# README: the post_build steps give effect to removing the content generated by the readthedocs build system
# whereby they do a "python -m mkdocs build ..."; there seems to be no way to stop that build step running so
# as a post_build action we remove and move our novella rendered content into place
13 changes: 13 additions & 0 deletions .safety-policy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Safety Security and License Configuration file
# https://docs.pyup.io/docs/safety-20-policy-file

security:
ignore-cvss-severity-below: 0
ignore-cvss-unknown-severity: False
ignore-vulnerabilities:
70612: # Vulnerability found in jinja2 version 3.1.4 - https://data.safetycli.com/v/70612/97c
expires: '2024-12-30'
66742: # Vulnerability found in black version 23.12.1 - https://data.safetycli.com/v/66742/97c
expires: '2024-12-30'

continue-on-vulnerability-error: False
21 changes: 0 additions & 21 deletions CHANGELOG.md

This file was deleted.

5 changes: 0 additions & 5 deletions MANIFEST.in

This file was deleted.

Loading

0 comments on commit 4ee2d1b

Please sign in to comment.