diff --git a/.flake8 b/.flake8 deleted file mode 100644 index 8d5b08b..0000000 --- a/.flake8 +++ /dev/null @@ -1,3 +0,0 @@ -[flake8] -max-line-length=120 -exclude=.git,__pycache__,build,dist,migrations diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 03ad545..3bd5bb7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,11 +9,11 @@ name: Build env: MAJOR: 0 MINOR: 0 - PYTHON_VERSION: 3.9.6 + PYTHON_VERSION: 3.10.1 # # Establish when the workflow is run -# We do build on every push except when we push onto main (which we ought to be subject to branch protection) +# We do build on every push except when we push onto main (which ought to be subject to branch protection) # We do build whenever a PR onto main is closed (see on) and the code is actually merged (see release job if) # Why is that okay? # 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: - name: Calculate Build Context run: | MRMAT_VERSION="${MAJOR}.${MINOR}.${GITHUB_RUN_NUMBER}" - if [ "$GITHUB_EVENT_NAME" == 'pull_request_target' ]; then + if [ "$GITHUB_EVENT_NAME" == 'pull_request_target' && GITHUB_BASE_REF == 'main']; then MRMAT_IS_RELEASE=true echo "::warning ::Building release ${MRMAT_VERSION}" echo "MRMAT_IS_RELEASE=true" >> $GITHUB_ENV @@ -62,22 +62,16 @@ jobs: - name: Establish a cache for dependencies uses: actions/cache@v2 with: - path: ~/.local + path: ${HOME}/.local key: ${{ runner.os }} - - name: Install dependencies + - name: Build run: | - python -m pip install --upgrade pip - pip install --user wheel + export PYTHONUSERBASE=${HOME}/.local pip install --user -r requirements.txt - pip install --user -r test-requirements.txt - - - name: Test - run: | - flake8 --statistics - pylint mrmat_python_api_flask - python ./setup.py install - python -m pytest + ${PYTHONUSERBASE}/bin/pylint ${GITHUB_WORKSPACE}/mrmat_python_api_flask + PYTHONPATH=${GITHUB_WORKSPACE} python -m pytest --cov=mrmat_python_api_flask + PYTHONPATH=${GITHUB_WORKSPACE} python -m build --wheel -n - name: Upload test results uses: actions/upload-artifact@v2 @@ -90,7 +84,7 @@ jobs: - name: Conditional Release uses: marvinpinto/action-automatic-releases@latest - if: github.event.pull_request.merged == true + if: (github.event.pull_request.merged == true && github.base_ref == 'main') with: repo_token: "${{ secrets.GITHUB_TOKEN }}" automatic_release_tag: "${{ env.MRMAT_VERSION }}" diff --git a/.gitignore b/.gitignore index 9a39490..a7b6698 100644 --- a/.gitignore +++ b/.gitignore @@ -245,3 +245,6 @@ dmypy.json .prof # End of https://www.toptal.com/developers/gitignore/api/jetbrains,python + +var/terraform/.terraform/ +var/terraform/.terraform.lock.hcl diff --git a/.idea/dataSources.xml b/.idea/dataSources.xml index 3847996..31fad70 100644 --- a/.idea/dataSources.xml +++ b/.idea/dataSources.xml @@ -1,11 +1,11 @@ - + postgresql true org.postgresql.Driver - jdbc:postgresql://localhost:5432/nostromodb + jdbc:postgresql://localhost:5432/localdb $ProjectFileDir$ diff --git a/.idea/jsLibraryMappings.xml b/.idea/jsLibraryMappings.xml new file mode 100644 index 0000000..d23208f --- /dev/null +++ b/.idea/jsLibraryMappings.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/markdown.xml b/.idea/markdown.xml new file mode 100644 index 0000000..064f873 --- /dev/null +++ b/.idea/markdown.xml @@ -0,0 +1,10 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 663d11b..4ea37de 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,9 +1,6 @@ - - - - + + @@ -12,8 +13,11 @@ + + + - + @@ -25,11 +29,6 @@