Skip to content

Commit 1d5d50b

Browse files
authored
Release (#17)
* Only run actions on pull_request * Added local docker configuration * create-react-app scaffold * Ignoring terraform generated-files * Added ui run configurations * Adjusted to local Python environment * Added proxy * Invoking the greetingv1 api * Reverted to project default Python * We build into the Python static files directory * Cosmetic change * Must match on the correct GH event to make a release * Removed the missing SAST badge * Added community guides * Introduced react API * Changed to class-based apis * Using compatible versions instead * Using semantic-ui and oidc context * Cosmetic change * Added additional datasources * Removed react UI * Version bump on flask-smorest * Added some notes on databases * MethodView mandates naming of methods We don't like that and prefer to retain flexibility. * Sanitised on the oidc integration * Adopted PEP517 * Renamed to match common practice * Use importlib.metadata instead of pkg_resources * Added local database * Installing the wheel instead of the source dist * We have no static files or templates * No longer required * Added Keycloak configuration * Excluding terraform dynamic directories * IDEA project file updates * Cosmetic change * Updated datasources * Experimental TED * Wrapping __version__ in try/catch block Because you may be developing on the project without having installed it just yet. * Switched from pkg_resources to importlib * in-progress * Replaced cli_ui/halo with rich and removed flake8 * Updated the readme with build instructions * IDEA project file update * Refactored the testsuite for persistent local services * WIP * Collapsed the database migrations So we can test with both SQLite and Postgres * Adjusted the user name * Testsuite works with local infrastructure * Added python-keycloak * Datasource update * Upgraded pylint * Fixed pylint logging complaints * Upgrading Python to 3.10.1 * Wrapping package version into try/catch * Need wheel * Re-enabling coverage * Added flask-smorest * Fixed bad import * IDEA project file update * Upgraded to Python 3.10.1 * Removed empty directory * More pythonic way of querying the env * Use psycopg2-binary * Cleaned up datasources * Fixed CUI run configuration * Generate the session signing key * Rudimentary client * Documentation update * Fixed complaint about logging
1 parent f2c8cd7 commit 1d5d50b

Some content is hidden

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

54 files changed

+1240
-647
lines changed

.flake8

Lines changed: 0 additions & 3 deletions
This file was deleted.

.github/workflows/build.yml

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ name: Build
99
env:
1010
MAJOR: 0
1111
MINOR: 0
12-
PYTHON_VERSION: 3.9.6
12+
PYTHON_VERSION: 3.10.1
1313

1414
#
1515
# Establish when the workflow is run
16-
# We do build on every push except when we push onto main (which we ought to be subject to branch protection)
16+
# We do build on every push except when we push onto main (which ought to be subject to branch protection)
1717
# We do build whenever a PR onto main is closed (see on) and the code is actually merged (see release job if)
1818
# Why is that okay?
1919
# Since we're making a PR, we know from the previous workflow run on push that the repo is okay and the PR
@@ -44,7 +44,7 @@ jobs:
4444
- name: Calculate Build Context
4545
run: |
4646
MRMAT_VERSION="${MAJOR}.${MINOR}.${GITHUB_RUN_NUMBER}"
47-
if [ "$GITHUB_EVENT_NAME" == 'pull_request_target' ]; then
47+
if [ "$GITHUB_EVENT_NAME" == 'pull_request_target' && GITHUB_BASE_REF == 'main']; then
4848
MRMAT_IS_RELEASE=true
4949
echo "::warning ::Building release ${MRMAT_VERSION}"
5050
echo "MRMAT_IS_RELEASE=true" >> $GITHUB_ENV
@@ -62,22 +62,16 @@ jobs:
6262
- name: Establish a cache for dependencies
6363
uses: actions/cache@v2
6464
with:
65-
path: ~/.local
65+
path: ${HOME}/.local
6666
key: ${{ runner.os }}
6767

68-
- name: Install dependencies
68+
- name: Build
6969
run: |
70-
python -m pip install --upgrade pip
71-
pip install --user wheel
70+
export PYTHONUSERBASE=${HOME}/.local
7271
pip install --user -r requirements.txt
73-
pip install --user -r test-requirements.txt
74-
75-
- name: Test
76-
run: |
77-
flake8 --statistics
78-
pylint mrmat_python_api_flask
79-
python ./setup.py install
80-
python -m pytest
72+
${PYTHONUSERBASE}/bin/pylint ${GITHUB_WORKSPACE}/mrmat_python_api_flask
73+
PYTHONPATH=${GITHUB_WORKSPACE} python -m pytest --cov=mrmat_python_api_flask
74+
PYTHONPATH=${GITHUB_WORKSPACE} python -m build --wheel -n
8175
8276
- name: Upload test results
8377
uses: actions/upload-artifact@v2
@@ -90,7 +84,7 @@ jobs:
9084
9185
- name: Conditional Release
9286
uses: marvinpinto/action-automatic-releases@latest
93-
if: github.event.pull_request.merged == true
87+
if: (github.event.pull_request.merged == true && github.base_ref == 'main')
9488
with:
9589
repo_token: "${{ secrets.GITHUB_TOKEN }}"
9690
automatic_release_tag: "${{ env.MRMAT_VERSION }}"

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,3 +245,6 @@ dmypy.json
245245
.prof
246246

247247
# End of https://www.toptal.com/developers/gitignore/api/jetbrains,python
248+
249+
var/terraform/.terraform/
250+
var/terraform/.terraform.lock.hcl

.idea/dataSources.xml

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

.idea/jsLibraryMappings.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.

.idea/markdown.xml

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

.idea/misc.xml

Lines changed: 1 addition & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/mrmat-python-api-flask.iml

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

.idea/runConfigurations/setup_py__sdist_.xml renamed to .idea/runConfigurations/build.xml

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

.idea/runConfigurations/client.xml

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

0 commit comments

Comments
 (0)