Skip to content

Commit bfa9fbc

Browse files
authored
Merge pull request #1 from MrMatAP/feature/modernisation
Feature/modernisation
2 parents ea772f4 + 9201430 commit bfa9fbc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+2346
-2
lines changed

.github/workflows/build.yml

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
#
2+
# How to build this
3+
4+
name: Build
5+
6+
#
7+
# Operational Variables
8+
9+
env:
10+
MAJOR: 0
11+
MINOR: 0
12+
PYTHON_VERSION: 3.13.0
13+
14+
#
15+
# Establish when the workflow is run
16+
# We do build on every push except when we push onto main (which ought to be subject to branch protection)
17+
# We do build whenever a PR onto main is closed (see on) and the code is actually merged (see release job if)
18+
# Why is that okay?
19+
# Since we're making a PR, we know from the previous workflow run on push that the repo is okay and the PR
20+
# shows that to us. A PR itself doesn't cause a build, except when it is closed and the changes were merged.
21+
22+
on:
23+
push:
24+
branches-ignore:
25+
- main
26+
pull_request_target:
27+
branches:
28+
- main
29+
types:
30+
- closed
31+
32+
#
33+
# Workflow
34+
35+
jobs:
36+
37+
build:
38+
runs-on: ubuntu-latest
39+
steps:
40+
41+
- name: Checkout out our code
42+
uses: actions/checkout@v3
43+
44+
- name: Calculate Build Context
45+
run: |
46+
MRMAT_VERSION="${MAJOR}.${MINOR}.${GITHUB_RUN_NUMBER}"
47+
if [ "$GITHUB_EVENT_NAME" == 'pull_request_target' && GITHUB_BASE_REF == 'main']; then
48+
MRMAT_IS_RELEASE=true
49+
echo "::warning ::Building release ${MRMAT_VERSION}"
50+
echo "MRMAT_IS_RELEASE=true" >> $GITHUB_ENV
51+
else
52+
MRMAT_VERSION="${MRMAT_VERSION}.dev0"
53+
echo "::warning ::Building version ${MRMAT_VERSION}"
54+
fi
55+
echo "MRMAT_VERSION=${MRMAT_VERSION}" >> $GITHUB_ENV
56+
57+
- name: Set up Python ${{ env.PYTHON_VERSION }}
58+
uses: actions/setup-python@v2
59+
with:
60+
python-version: ${{ env.PYTHON_VERSION }}
61+
62+
- name: Establish a cache for dependencies
63+
uses: actions/cache@v4
64+
with:
65+
path: |
66+
~/.local
67+
~/.cache/pip
68+
key: ${{ runner.os }}
69+
70+
- name: Build
71+
run: |
72+
export PYTHONUSERBASE=${HOME}/.local
73+
pip install --user -r requirements.txt -r requirements.dev.txt
74+
PYTHONPATH=${GITHUB_WORKSPACE}/src pytest
75+
PYTHONPATH=${GITHUB_WORKSPACE}/src python -m build --wheel -n
76+
77+
- name: Upload test results
78+
uses: actions/upload-artifact@v4
79+
if: ${{ always() }}
80+
with:
81+
name: Test and Coverage
82+
path: |
83+
build/junit.xml
84+
build/coverage.xml
85+
86+
- name: Conditional Release
87+
uses: marvinpinto/action-automatic-releases@latest
88+
if: (github.event.pull_request.merged == true && github.base_ref == 'main')
89+
with:
90+
repo_token: "${{ secrets.GITHUB_TOKEN }}"
91+
automatic_release_tag: "${{ env.MRMAT_VERSION }}"
92+
prerelease: false
93+
title: "Release ${{ env.MRMAT_VERSION }}"

.gitignore

Lines changed: 250 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,250 @@
1+
2+
# Created by https://www.toptal.com/developers/gitignore/api/jetbrains,python
3+
# Edit at https://www.toptal.com/developers/gitignore?templates=jetbrains,python
4+
5+
### JetBrains ###
6+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
7+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
8+
9+
# User-specific stuff
10+
.idea/**/workspace.xml
11+
.idea/**/tasks.xml
12+
.idea/**/usage.statistics.xml
13+
.idea/**/dictionaries
14+
.idea/**/shelf
15+
16+
# Generated files
17+
.idea/**/contentModel.xml
18+
19+
# Sensitive or high-churn files
20+
.idea/**/dataSources/
21+
.idea/**/dataSources.ids
22+
.idea/**/dataSources.local.xml
23+
.idea/**/sqlDataSources.xml
24+
.idea/**/dynamic.xml
25+
.idea/**/uiDesigner.xml
26+
.idea/**/dbnavigator.xml
27+
28+
# Gradle
29+
.idea/**/gradle.xml
30+
.idea/**/libraries
31+
32+
# Gradle and Maven with auto-import
33+
# When using Gradle or Maven with auto-import, you should exclude module files,
34+
# since they will be recreated, and may cause churn. Uncomment if using
35+
# auto-import.
36+
# .idea/artifacts
37+
# .idea/compiler.xml
38+
# .idea/jarRepositories.xml
39+
# .idea/modules.xml
40+
# .idea/*.iml
41+
# .idea/modules
42+
# *.iml
43+
# *.ipr
44+
45+
# CMake
46+
cmake-build-*/
47+
48+
# Mongo Explorer plugin
49+
.idea/**/mongoSettings.xml
50+
51+
# File-based project format
52+
*.iws
53+
54+
# IntelliJ
55+
out/
56+
57+
# mpeltonen/sbt-idea plugin
58+
.idea_modules/
59+
60+
# JIRA plugin
61+
atlassian-ide-plugin.xml
62+
63+
# Cursive Clojure plugin
64+
.idea/replstate.xml
65+
66+
# Crashlytics plugin (for Android Studio and IntelliJ)
67+
com_crashlytics_export_strings.xml
68+
crashlytics.properties
69+
crashlytics-build.properties
70+
fabric.properties
71+
72+
# Editor-based Rest Client
73+
.idea/httpRequests
74+
75+
# Android studio 3.1+ serialized cache file
76+
.idea/caches/build_file_checksums.ser
77+
78+
### JetBrains Patch ###
79+
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
80+
81+
# *.iml
82+
# modules.xml
83+
# .idea/misc.xml
84+
# *.ipr
85+
86+
# Sonarlint plugin
87+
# https://plugins.jetbrains.com/plugin/7973-sonarlint
88+
.idea/**/sonarlint/
89+
90+
# SonarQube Plugin
91+
# https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin
92+
.idea/**/sonarIssues.xml
93+
94+
# Markdown Navigator plugin
95+
# https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced
96+
.idea/**/markdown-navigator.xml
97+
.idea/**/markdown-navigator-enh.xml
98+
.idea/**/markdown-navigator/
99+
100+
# Cache file creation bug
101+
# See https://youtrack.jetbrains.com/issue/JBR-2257
102+
.idea/$CACHE_FILE$
103+
104+
# CodeStream plugin
105+
# https://plugins.jetbrains.com/plugin/12206-codestream
106+
.idea/codestream.xml
107+
108+
### Python ###
109+
# Byte-compiled / optimized / DLL files
110+
__pycache__/
111+
*.py[cod]
112+
*$py.class
113+
114+
# C extensions
115+
*.so
116+
117+
# Distribution / packaging
118+
.Python
119+
build/
120+
develop-eggs/
121+
dist/
122+
downloads/
123+
eggs/
124+
.eggs/
125+
lib/
126+
lib64/
127+
parts/
128+
sdist/
129+
wheels/
130+
pip-wheel-metadata/
131+
share/python-wheels/
132+
*.egg-info/
133+
.installed.cfg
134+
*.egg
135+
MANIFEST
136+
137+
# PyInstaller
138+
# Usually these files are written by a python script from a template
139+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
140+
*.manifest
141+
*.spec
142+
143+
# Installer logs
144+
pip-log.txt
145+
pip-delete-this-directory.txt
146+
147+
# Unit test / coverage reports
148+
htmlcov/
149+
.tox/
150+
.nox/
151+
.coverage
152+
.coverage.*
153+
.cache
154+
nosetests.xml
155+
coverage.xml
156+
*.cover
157+
*.py,cover
158+
.hypothesis/
159+
.pytest_cache/
160+
pytestdebug.log
161+
162+
# Translations
163+
*.mo
164+
*.pot
165+
166+
# Django stuff:
167+
*.log
168+
local_settings.py
169+
db.sqlite3
170+
db.sqlite3-journal
171+
172+
# Flask stuff:
173+
instance/
174+
.webassets-cache
175+
176+
# Scrapy stuff:
177+
.scrapy
178+
179+
# Sphinx documentation
180+
docs/_build/
181+
doc/_build/
182+
183+
# PyBuilder
184+
target/
185+
186+
# Jupyter Notebook
187+
.ipynb_checkpoints
188+
189+
# IPython
190+
profile_default/
191+
ipython_config.py
192+
193+
# pyenv
194+
.python-version
195+
196+
# pipenv
197+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
198+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
199+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
200+
# install all needed dependencies.
201+
#Pipfile.lock
202+
203+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
204+
__pypackages__/
205+
206+
# Celery stuff
207+
celerybeat-schedule
208+
celerybeat.pid
209+
210+
# SageMath parsed files
211+
*.sage.py
212+
213+
# Environments
214+
.env
215+
.venv
216+
env/
217+
venv/
218+
ENV/
219+
env.bak/
220+
venv.bak/
221+
pythonenv*
222+
223+
# Spyder project settings
224+
.spyderproject
225+
.spyproject
226+
227+
# Rope project settings
228+
.ropeproject
229+
230+
# mkdocs documentation
231+
/site
232+
233+
# mypy
234+
.mypy_cache/
235+
.dmypy.json
236+
dmypy.json
237+
238+
# Pyre type checker
239+
.pyre/
240+
241+
# pytype static type analyzer
242+
.pytype/
243+
244+
# profiling data
245+
.prof
246+
247+
# End of https://www.toptal.com/developers/gitignore/api/jetbrains,python
248+
249+
250+
.coverage

.idea/.gitignore

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/copyright/MIT.xml

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/copyright/profiles_settings.xml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/dataSources.xml

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/profiles_settings.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)