Skip to content

Commit

Permalink
Merge pull request #385 from Der-Henning/poetry
Browse files Browse the repository at this point in the history
Poetry
  • Loading branch information
Der-Henning committed Jul 29, 2023
2 parents 828ff80 + e78f99b commit d7911d6
Show file tree
Hide file tree
Showing 80 changed files with 2,361 additions and 972 deletions.
4 changes: 2 additions & 2 deletions .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ coverage:
threshold: 1.0%
base: auto
branches:
- main
- dev
- main
- dev
13 changes: 8 additions & 5 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@ FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT}
ARG NODE_VERSION="none"
RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi

# Poetry
ARG POETRY_VERSION="none"
ENV POETRY_VIRTUALENVS_IN_PROJECT=true
RUN if [ "${POETRY_VERSION}" != "none" ]; then su vscode -c "umask 0002 && pip3 install poetry==${POETRY_VERSION}"; fi

# [Optional] If your pip requirements rarely change, uncomment this section to add them to the image.
COPY requirements.txt /tmp/pip-tmp/
COPY requirements-build.txt /tmp/pip-tmp/
COPY requirements-dev.txt /tmp/pip-tmp/
# COPY requirements.txt /tmp/pip-tmp/

RUN pip3 --disable-pip-version-check --no-cache-dir install -r /tmp/pip-tmp/requirements-dev.txt \
&& rm -rf /tmp/pip-tmp
# RUN pip3 --disable-pip-version-check --no-cache-dir install -r /tmp/pip-tmp/requirements.txt \
# && rm -rf /tmp/pip-tmp

# [Optional] Uncomment this section to install additional OS packages.
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
Expand Down
40 changes: 16 additions & 24 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,51 +9,43 @@
// Update 'VARIANT' to pick a Python version: 3, 3.10, 3.9, 3.8, 3.7, 3.6
// Append -bullseye or -buster to pin to an OS version.
// Use -bullseye variants on local on arm64/Apple Silicon.
"VARIANT": "3.10"
"VARIANT": "3.10",
// Options
// "NODE_VERSION": "lts/*"
// "NODE_VERSION": "lts/*",
"POETRY_VERSION": "1.5.1"
}
},
// "runArgs": [
// "--env-file",
// ".env"
// ],
// Set *default* container specific settings.json values on container create.
"customizations": {
"vscode": {
"settings": {
"python.defaultInterpreterPath": "/usr/local/bin/python",
"python.linting.enabled": true,
"python.linting.flake8Enabled": true,
"python.linting.flake8Args": [
"--max-line-length=79"
],
"python.linting.pylintEnabled": false,
"python.formatting.provider": "autopep8",
"python.formatting.autopep8Args": [
"--in-place",
"--max-line-length=79"
],
"python.testing.pytestEnabled": true,
"python.defaultInterpreterPath": "./.venv/bin/python",
"python.terminal.activateEnvironment": true,
"python.terminal.activateEnvInCurrentTerminal": true,
"editor.rulers": [79],
"python.testing.pytestArgs": [
"tests"
],
"isort.check": true
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"ms-python.python",
"njpwerner.autodocstring"
"GitHub.vscode-pull-request-github"
]
}
},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
"forwardPorts": [
8000
],
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "pre-commit install --install-hooks",
"postCreateCommand": "poetry install && poetry run pre-commit install --install-hooks",
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode",
"features": {
// "git": "latest"
// "ghcr.io/devcontainers/features/docker-in-docker:2": {},
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {}
}
}
24 changes: 20 additions & 4 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
__pycache__
*/.env
*/config.ini
*/scanner.log
# Ignore everything
*

# Allow files and directories
!/docker
!/requirements.txt
!/tgtg_scanner
!/pyproject.toml
!/poetry.lock
!/README.md
!/LICENSE

# Ignore unnecessary files inside allowed directories
# This should go after the allowed directories
**/.DS_Store
**/Thumbs.db
**/__pycache__/
**/.ipynb_checkpoints/
**/config.ini
**/scanner.log
14 changes: 7 additions & 7 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

version: 2
updates:
- package-ecosystem: "pip" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "daily"
target-branch: "dev"
assignees:
- "Der-Henning"
- package-ecosystem: pip # See documentation for possible values
directory: / # Location of package manifests
schedule:
interval: daily
target-branch: dev
assignees:
- Der-Henning
9 changes: 6 additions & 3 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
### Pull Request Checklist:
<!-- markdownlint-disable-next-line MD041 -->
### Pull Request Checklist

* [ ] Have you checked to ensure there aren't other open [Pull Requests](../../pulls) for the same update/change?
* [ ] Have you checked to ensure there aren't other open
[Pull Requests](../../pulls) for the same update/change?
* [ ] Did you make your Pull Request on the dev branch?
* [ ] Does your submission pass tests? `make test`
* [ ] Have you lint your code locally prior to submission? `make lint`
* [ ] Could you build and run the docker image successfully? `make image`
* [ ] Could you create a running executable? `make executable`
* [ ] Have you added an explanation of what your changes do and why you'd like to include them?
* [ ] Have you added an explanation of what your changes do
and why you'd like to include them?
* [ ] Have you written new tests for your changes, as applicable?
* [ ] Have you successfully ran manual tests with your changes locally?
12 changes: 6 additions & 6 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
pull_request:
schedule:
- cron: "0 1 * * *"
- cron: 0 1 * * *

jobs:
code-ql:
Expand All @@ -15,8 +15,8 @@ jobs:
contents: read
security-events: write
steps:
- uses: actions/checkout@v3
- uses: github/codeql-action/init@v2
with:
languages: "python"
- uses: github/codeql-action/analyze@v2
- uses: actions/checkout@v3
- uses: github/codeql-action/init@v2
with:
languages: python
- uses: github/codeql-action/analyze@v2
25 changes: 25 additions & 0 deletions .github/workflows/publish-wiki.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Publish wiki

on:
push:
branches: [main]
paths:
- wiki/**
- .github/workflows/publish-wiki.yml

concurrency:
group: publish-wiki
cancel-in-progress: true

permissions:
contents: write

jobs:
publish-wiki:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: impresscms-dev/strip-markdown-extensions-from-links-action@v1.0.0
with:
path: wiki
- uses: Andrew-Chen-Wang/github-wiki-action@v4
Loading

0 comments on commit d7911d6

Please sign in to comment.