Skip to content

Commit

Permalink
Merge pull request #101 from Samreay/develop
Browse files Browse the repository at this point in the history
Updating to python 3.10
  • Loading branch information
Samreay authored Oct 9, 2023
2 parents 8889219 + ee4a356 commit 1e7c415
Show file tree
Hide file tree
Showing 139 changed files with 8,937 additions and 8,785 deletions.
6 changes: 0 additions & 6 deletions .codacy.yml

This file was deleted.

16 changes: 0 additions & 16 deletions .coveragerc

This file was deleted.

64 changes: 64 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: CICD

on:
push:
pull_request:
types: [opened]
workflow_dispatch:
release:
types: [created]

defaults:
run:
shell: bash

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: pip install poetry
- uses: actions/setup-python@v4
with:
python-version: '3.10'
architecture: 'x64'
cache: 'poetry'
- run: make install
- run: make precommit

docs:
runs-on: ubuntu-latest
needs: [test]
steps:
- uses: actions/checkout@v4
- run: pip install poetry
- uses: actions/setup-python@v4
with:
python-version: '3.10'
architecture: 'x64'
cache: 'poetry'
- run: make install
- run: make docs
- run: make pushdocs
if: |
github.event_name == 'release' || github.ref == 'refs/heads/master'
build_and_publish:
runs-on: ubuntu-latest
needs: [test]
steps:
- uses: actions/checkout@v4
- run: pip install poetry
- uses: actions/setup-python@v4
with:
python-version: '3.10'
architecture: 'x64'
cache: 'poetry'
- run: make install
- run: make build
- name: Publish
run: make publish
if: github.event_name == 'release'
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}

136 changes: 50 additions & 86 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,99 +1,63 @@
# Byte-compiled / optimized / DLL files
__pycache__/
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so

# OS generated files #
######################
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db

# PYTHON #
__pycache__
*.py[cod]
*$py.class
*.py~

# PyCharm
.idea/*
# envs
.env
.venv

# C extensions
*.so
# To use VS code
.vscode

# Distribution / packaging
.Python
env/
# Setup.py build
build/
develop-eggs/
*egg-info/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# Sphinx doco
doc/out/**

# 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/
.pytest
.pytest_cache
.mypy_cache
id_rsa
*.ipynb
coverage*
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# IPython Notebook
.dmypy.json
dmypy.json
.idea
.ipynb_checkpoints

# pyenv
.ruff_cache
.cache
profile_default/
ipython_config.py
__pypackages__/
.python-version
qodana.yaml

# celery beat schedule file
celerybeat-schedule

# dotenv
.env

# virtualenv
venv/
ENV/

# Spyder project settings
.spyderproject
**/*.log
**/*tmp*
**/*secret*
**/*.pkl

# Rope project settings
.ropeproject
doc/examples/*
doc/modules/*
doc/out/
.vscode
generated/
.mypy_cache
32 changes: 32 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-added-large-files
args: ["--maxkb=5000"]
- id: check-toml
- id: check-json
- id: check-symlinks
- id: debug-statements
- id: detect-private-key
- id: check-yaml
args:
- --unsafe
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 23.9.1
hooks:
- id: black
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.292
hooks:
- id: ruff
args: ["--fix"]
- repo: local
hooks:
- id: tests
name: tests
language: system
types: [python]
pass_filenames: false
entry: poetry run pytest
67 changes: 0 additions & 67 deletions .travis.yml

This file was deleted.

9 changes: 9 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Guide for contributing!

1. Please read over the online documentation, or use GitHub discussions to chat if you're unsure about anything.
2. Fork the repo + clone it out
3. I highly recommend either a nix system or using the Windows Subsystem for Linux
4. Install a developer version by running (in the directory you just cloned into): `make install`
1. This should install poetry, dependencies, and a pre-commit hook
2. Verify it all looks good by running `make precommit`
5. Code!
34 changes: 34 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
.PHONY: tests docs build
VERSION := $(shell git for-each-ref refs/tags --format='%(refname:short)' | grep -E "^v?[0-9]+\..*" | tail -n1)

install:
pip install -U pip poetry -q
poetry install --with=dev,test --all-extras
poetry run pre-commit install
poetry run pre-commit autoupdate

precommit:
poetry run pre-commit run --all-files

test:
poetry run pytest

serve:
rm -rf docs/generated/gallery;
poetry run mkdocs serve --clean

docs:
poetry run poetry version $(VERSION) && poetry run mkdocs build

pushdocs:
poetry run poetry version $(VERSION) && poetry run mkdocs gh-deploy --force

build:
rm -rf dist; poetry version $(VERSION) && poetry publish --build --dry-run

publish:
rm -rf dist; poetry config pypi-token.pypi $PYPI_TOKEN && poetry version $(VERSION) && poetry publish --build -y

tests: test

all: precommit tests
Loading

0 comments on commit 1e7c415

Please sign in to comment.