Skip to content

Commit

Permalink
First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
LanderOtto committed May 7, 2024
0 parents commit 857a973
Show file tree
Hide file tree
Showing 21 changed files with 1,276 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[flake8]
max-line-length = 88
extend-ignore = E203,E501
12 changes: 12 additions & 0 deletions .github/codeql/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: "StreamFlow LSF CodeQL configuration"
queries:
- uses: security-and-quality
paths-ignore:
- tests
query-filters:
# Reason: this rule targets XSS, which is not a concern here
- exclude:
id: py/jinja2/autoescape-false
# Reason: false positive on function body ellipsis (issue 11351)
- exclude:
id: py/ineffectual-statement
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "daily"
48 changes: 48 additions & 0 deletions .github/workflows/ci-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: "CI Tests"
on:
push:
branches:
- master
pull_request:
branches:
- master
concurrency:
group: build-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
code-ql-check:
name: "CodeQL check"
runs-on: ubuntu-22.04
permissions:
security-events: write
steps:
- uses: actions/checkout@v4
- uses: github/codeql-action/init@v3
with:
config-file: .github/codeql/config.yml
languages: python
- uses: github/codeql-action/analyze@v3
static-checks:
name: "Static checks"
runs-on: ubuntu-22.04
strategy:
matrix:
step: [ "bandit", "lint" ]
env:
TOXENV: ${{ matrix.step }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
cache-dependency-path: |
requirements.txt
test-requirements.txt
tox.ini
- name: "Install Python Dependencies and plugin"
run: |
python -m pip install tox --user
python -m pip install . --user
- name: "Run static analysis via Tox"
run: tox
60 changes: 60 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: "Release new version"
on:
workflow_run:
workflows:
- "CI Tests"
branches:
- master
types:
- completed
jobs:
github:
name: "Create GitHub Release"
runs-on: ubuntu-22.04
permissions:
contents: write
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- uses: actions/checkout@v4
- name: "Get version"
run: echo "PLUGIN_VERSION=$(cat streamflow_lsf/version.py | grep -oP '(?<=VERSION = \")(.*)(?=\")')" >> $GITHUB_ENV
- name: "Check tag existence"
uses: mukunku/[email protected]
id: check-tag
with:
tag: ${{ env.PLUGIN_VERSION }}
- name: "Create Release"
id: create-release
uses: actions/create-release@v1
if: ${{ steps.check-tag.outputs.exists == 'false' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.PLUGIN_VERSION }}
release_name: ${{ env.PLUGIN_VERSION }}
draft: false
prerelease: false
pypi:
name: "Publish on PyPI"
runs-on: ubuntu-22.04
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: "Get local version"
run: echo "PLUGIN_VERSION=$(cat streamflow_lsf/version.py | grep -oP '(?<=VERSION = \")(.*)(?=\")')" >> $GITHUB_ENV
- name: "Get PyPI version"
run: echo "PYPI_VERSION=$(pip index versions --pre streamflow-lsf | grep streamflow-lsf | sed 's/.*(\(.*\))/\1/')" >> $GITHUB_ENV
- name: "Build Python packages"
if: ${{ env.PLUGIN_VERSION != env.PYPI_VERSION }}
run: |
python -m pip install build --user
python -m build --sdist --wheel --outdir dist/ .
- name: "Publish package to PyPI"
uses: pypa/gh-action-pypi-publish@release/v1
if: ${{ env.PLUGIN_VERSION != env.PYPI_VERSION }}
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
133 changes: 133 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# 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/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# IDE
.idea

# Mac OS X
.DS_Store

# StreamFlow
.streamflow
Loading

0 comments on commit 857a973

Please sign in to comment.