Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added .codespellignore
Empty file.
13 changes: 13 additions & 0 deletions .cookiecutter.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"cookiecutter": {
"_checkout": null,
"_output_dir": "/Users/c0fec0de/projects",
"_repo_dir": "/Users/c0fec0de/.cookiecutters/python-template",
"_template": "gh:nbiotcloud/python-template",
"name": "defaultlist",
"snake_name": "defaultlist",
"title": "Automatically Extending List",
"user": "c0fec0de",
"year": "2017"
}
}
70 changes: 40 additions & 30 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,54 +1,64 @@
name: test

name: main
on: [push, pull_request, release]

jobs:
build:

test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
runs-on: ubuntu-latest
os:
- "ubuntu-latest"
- "macos-latest"
- "windows-latest"
python-version:
- "3.10"
- "3.11"
- "3.12"
- "3.13"
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: astral-sh/setup-uv@v5
with:
version: "0.6.9"
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
sudo apt-get install -y graphviz
pip install tox "poetry>=1.4" coveralls
- name: TOX
run: tox
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Run all
run: make all
- name: Upload coverage data to coveralls.io
run: coveralls --service=github
run: uv run --frozen -- coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: ${{ matrix.test-name }}
COVERALLS_PARALLEL: true

coveralls:
name: Indicate completion to coveralls.io
needs: build
needs: test
runs-on: ubuntu-latest
container: python:3-slim
steps:
- name: Finished
run: |
pip3 install --upgrade coveralls
coveralls --service=github --finish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: astral-sh/setup-uv@v5
with:
version: "0.6.9"
python-version: ${{ matrix.python-version }}
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Upload coverage data to coveralls.io
run: uv run --frozen -- coveralls --service=github --finish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

publish:
if: github.event_name == 'push' && github.ref_type == 'tag'
needs: coveralls
name: upload release to PyPI
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@v3
- name: Build and publish to pypi
uses: JRubics/poetry-publish@v1.17
with:
pypi_token: ${{ secrets.PYPI_TOKEN }}
- uses: actions/checkout@v4
- uses: pdm-project/setup-pdm@v4
- name: Publish package distributions to PyPI
run: pdm publish
26 changes: 14 additions & 12 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
*.egg-info/
*.xml
.coverage
.tox
.venv
.mypy_cache
/.vscode
__pycache__
build
.*_cache/
.coverage*
.DS_Store
.hypothesis
.nox/
.pdm-python
.test2ref
.venv*
*.egg-info
*.pyc
build/
dist/
docs/_readthedocs/
poetry.lock
setup.py
docs.zip
report.xml
site/
47 changes: 47 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.11.2
hooks:
# Run the linter.
- id: ruff
args: [--fix]
# Run the formatter.
- id: ruff-format

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-toml
- id: check-json
- id: check-xml
- id: debug-statements
- id: check-added-large-files
- id: check-merge-conflict
- id: mixed-line-ending

- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.5
hooks:
- id: remove-tabs
args: [--whitespaces-count, "2"] # defaults to: 4
- id: insert-license
files: \.py$
args:
- --license-filepath
- LICENSE
- --use-current-year

- repo: https://github.com/codespell-project/codespell
rev: v2.4.1
hooks:
- id: codespell
args:
- "--write-changes"
- "--ignore-words=.codespellignore"
additional_dependencies:
- tomli
exclude: '^uv\.lock$'
10 changes: 5 additions & 5 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ version: 2
build:
os: ubuntu-22.04
tools:
python: "3.9"
python: "3.11"

commands:
- pip install --upgrade --no-cache-dir pip
- pip install --no-cache-dir "poetry>=1.4" "crashtest==0.4.1"
- poetry install --with=doc --without=test
- poetry run make html -C docs
- cp -r docs/build _readthedocs
- pip install --no-cache-dir uv
- make doc
- mkdir _readthedocs
- cp -r site _readthedocs/html
72 changes: 35 additions & 37 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,57 +1,55 @@
# Contribute
# CONTRIBUTING

## Testing
Please follow the github workflow. Create a ticket and/or branch. Create a pull-request.

### Create Environment
## Local Development

Run these commands just the first time:
### Installation

```bash
# Ensure python3 is installed
python3 -m venv .venv
source .venv/bin/activate
pip install tox "poetry>=1.4"
```
Please install these tools:

### Enter Environment
* [`uv` Installation](https://docs.astral.sh/uv/getting-started/installation/)
* [`make`](https://www.gnu.org/software/make/)
* [`git`](https://git-scm.com/)
* [Visual Studio Code](https://code.visualstudio.com/)

Run this command once you open a new shell:

### Editor
Start Visual Studio Code:

```bash
source .venv/bin/activate
make code
```

### Test Your Changes
### Testing

Run auto-formatting, linting, tests and documentation build:

```bash
# test
tox
make all
```

### Release
See `make help` for any further details.

```bash
prev_version=$(poetry version -s)

# Ensure main
git checkout main
git pull

# Version Bump
poetry version minor
# OR
poetry version patch
## Project Structure

# Commit, Tag and Push
version=$(poetry version -s)
The project contains these files and directories:

sed "s/$prev_version/$version/g" -i README.rst
sed "s/$prev_version/$version/g" -i docs/index.rst
| File/Directory | Description |
|---|---|
| `src/` | Python Package Sources - the files this is all about |
| `pyproject.toml` | Python Package Meta File. Also contains all tool settings |
| `.gitignore` | Lists of files and directories ignored by version control system |
| `.github/` | Github Settings |
| `.readthedocs.yaml` | Documentation Server Configuration |
| `.pre-commit-config.yaml` | Pre-Commit Check Configuration |
| `uv.lock` | File with resolved python package dependencies |

git commit -m"version bump to ${version}" pyproject.toml README.rst docs/index.rst
git tag "${version}" -m "Release ${version}"
git push
git push --tags
Next to that, there are some temporary files ignored by version control system.

# Publishing is handled by CI
```
| File/Directory | Description |
|---|---|
| `htmlcov/` | Test Execution Code Coverage Report in HTML format |
| `report.xml` | Test Execution Report |
| `.venv` | Virtual Environments |
Loading