Skip to content

Commit

Permalink
Initial commit 🔮
Browse files Browse the repository at this point in the history
  • Loading branch information
g-nie committed Jun 19, 2024
0 parents commit e786035
Show file tree
Hide file tree
Showing 31 changed files with 1,677 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Keep GitHub Actions up to date with GitHub's Dependabot...
# https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#package-ecosystem
version: 2
updates:
- package-ecosystem: github-actions
directory: /
groups:
github-actions:
patterns:
- "*" # Group all Actions updates into a single larger pull request
schedule:
interval: weekly
117 changes: 117 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
name: CI

on:
pull_request:
branches:
- main

concurrency:
group: test-${{ github.head_ref }}
cancel-in-progress: true

env:
PYTHONUNBUFFERED: "1"
FORCE_COLOR: "1"

jobs:
test:
name: Python ${{ matrix.python-version }}, Django ${{ matrix.django-version }}
runs-on: "ubuntu-latest"
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]
django-version: ["4.2", "5.0", "main"]
steps:
- uses: actions/checkout@v4

- uses: extractions/setup-just@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
allow-prereleases: true

- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [[ "${{ matrix.django-version }}" == "main" ]]; then
python -m pip install https://github.com/django/django/archive/refs/heads/main.zip
else
python -m pip install django==${{ matrix.django-version }}
fi
python -m pip install '.[tests]'
- name: Run tests
run: |
just test
# tests:
# runs-on: ubuntu-latest
# needs: test
# if: always()
# steps:
# - name: OK
# if: ${{ !(contains(needs.*.result, 'failure')) }}
# run: exit 0
# - name: Fail
# if: ${{ contains(needs.*.result, 'failure') }}
# run: exit 1

coverage:
runs-on: ubuntu-latest
env:
PYTHON_MIN_VERSION: "3.10"
DJANGO_MIN_VERSION: "4.2"
steps:
- uses: actions/checkout@v4

- uses: extractions/setup-just@v2

- name: Set up Python ${{ env.PYTHON_MIN_VERSION }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_MIN_VERSION }}
cache: "pip"
allow-prereleases: true

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install django==${{ env.DJANGO_MIN_VERSION }}
python -m pip install '.[tests, dev]'
- name: Run coverage
run: |
just coverage
ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install '.[dev]'
- name: Run ruff
run: |
ruff check .
ruff format --check
mypy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install '.[dev]'
- name: Run mypy
run: |
mypy .
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
__pycache__
dist
.idea
.venv
.coverage
43 changes: 43 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
default_language_version:
python: python3.12

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-json
- id: check-merge-conflict
- id: check-symlinks
- id: check-toml
- id: end-of-file-fixer
exclude_types: [text]
- id: trailing-whitespace
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.7
hooks:
- id: ruff
- id: ruff-format
- repo: https://github.com/rstcheck/rstcheck
rev: v6.2.1
hooks:
- id: rstcheck
additional_dependencies:
- tomli==2.0.1
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.2
hooks:
- id: pyupgrade
args: [--py310-plus]
- repo: https://github.com/adamchainz/django-upgrade
rev: 1.18.0
hooks:
- id: django-upgrade
args: [--target-version, '4.2']
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.10.0
hooks:
- id: mypy
additional_dependencies:
- django-stubs==5.0.2
8 changes: 8 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
=========
CHANGELOG
=========

0.1.0 (2024-06-19)
==================

Initial release.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2024 Giannis Terzopoulos

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Loading

0 comments on commit e786035

Please sign in to comment.