-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
17 changed files
with
334 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: "[rdock-utils] Lint and Test" | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build rdock-utils dev image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: ./rdock-utils | ||
tags: ghcr.io/cbdd/rdock-utils:dev | ||
file: ./rdock-utils/Dockerfile | ||
target: development | ||
cache-from: type=gha,scope=rdock-utils | ||
cache-to: type=gha,mode=max,scope=rdock-utils | ||
load: true | ||
|
||
- name: flake8 | ||
run: docker run --rm -v $PWD/rdock-utils:/rdock-utils -w /rdock-utils ghcr.io/cbdd/rdock-utils:dev flake8 . | ||
|
||
- name: black | ||
run: docker run --rm -v $PWD/rdock-utils:/rdock-utils -w /rdock-utils ghcr.io/cbdd/rdock-utils:dev black --check . | ||
|
||
- name: isort | ||
run: docker run --rm -v $PWD/rdock-utils:/rdock-utils -w /rdock-utils ghcr.io/cbdd/rdock-utils:dev isort --check . | ||
|
||
- name: mypy | ||
run: docker run --rm -v $PWD/rdock-utils:/rdock-utils -w /rdock-utils ghcr.io/cbdd/rdock-utils:dev mypy . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{ | ||
"name": "rdock-utils", | ||
"build": { | ||
"dockerfile": "../Dockerfile", | ||
"context": "..", | ||
"target": "development" | ||
}, | ||
"customizations": { | ||
"vscode": { | ||
"settings": { | ||
"python.languageServer": "Pylance", | ||
"python.linting.enabled": true, | ||
"python.linting.flake8Enabled": true, | ||
"python.formatting.provider": "black", | ||
"python.linting.mypyEnabled": false, | ||
"isort.check": true, | ||
"python.testing.pytestEnabled": true, | ||
"python.testing.pytestArgs": [ | ||
"tests" | ||
], | ||
"python.formatting.blackArgs": [ | ||
"--line-length", | ||
"119" | ||
], | ||
"isort.args": [ | ||
"--profile", | ||
"black" | ||
], | ||
"[python]": { | ||
"editor.codeActionsOnSave": { | ||
"source.organizeImports": true | ||
} | ||
}, | ||
"editor.formatOnSave": true, | ||
"files.autoSave": "afterDelay", | ||
"files.autoSaveDelay": 1000 | ||
}, | ||
"extensions": [ | ||
"ms-python.python", | ||
"littlefoxteam.vscode-python-test-adapter", | ||
"ms-vsliveshare.vsliveshare", | ||
"mhutchie.git-graph", | ||
"ms-toolsai.jupyter" | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
# 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 | ||
*.py,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 | ||
|
||
# PEP 582; used by e.g. github.com/David-OConnor/pyflow | ||
__pypackages__/ | ||
|
||
# Celery stuff | ||
celerybeat-schedule | ||
celerybeat.pid | ||
|
||
# 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/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
FROM python:3.12 AS base | ||
|
||
COPY requirements.txt requirements.txt | ||
RUN python -m pip install --upgrade pip | ||
RUN python -m pip install -r requirements.txt | ||
|
||
FROM base AS development | ||
|
||
COPY requirements-dev.txt requirements-dev.txt | ||
RUN python -m pip install -r requirements-dev.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# rdock-utils python package | ||
|
||
coming soon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[tool.black] | ||
line-length = 119 | ||
target-version = ['py312'] | ||
|
||
[tool.isort] | ||
profile = "black" | ||
line_length = 119 | ||
combine_as_imports = true | ||
|
||
import_heading_stdlib = "Standard Library" | ||
import_heading_thirdparty = "Dependencies" | ||
import_heading_firstparty = "From apps" | ||
import_heading_localfolder = "Local imports" |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
def main() -> None: | ||
print("to be removed when we start having code migrated over here") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
black | ||
flake8 | ||
isort | ||
mypy | ||
pytest |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/usr/bin/env python3 | ||
|
||
# remove this script when the first script is migrated here | ||
# actual code for the scripts should be in rdock_utils.<dedicated_script_name_module> | ||
# for example, | ||
# from rdock_utils.sdsort import main | ||
|
||
# From apps | ||
from rdock_utils.sdnothing import main | ||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
[flake8] | ||
max-line-length = 119 | ||
exclude = .git,__pycache__ | ||
ignore = E231,E501,E203,W503 | ||
|
||
|
||
[mypy] | ||
python_version = 3.12 | ||
pretty = True | ||
show_error_context = True | ||
show_error_codes = True | ||
|
||
follow_imports = silent | ||
ignore_missing_imports = True | ||
|
||
disallow_incomplete_defs = True | ||
disallow_any_generics = True | ||
disallow_subclassing_any = False | ||
disallow_untyped_calls = True | ||
disallow_untyped_defs = True | ||
disallow_untyped_decorators = True | ||
|
||
warn_unused_configs = True | ||
warn_unreachable = True | ||
warn_redundant_casts = True | ||
warn_unused_ignores = True | ||
warn_return_any = True | ||
|
||
check_untyped_defs = True | ||
|
||
no_implicit_optional = True | ||
no_implicit_reexport = False | ||
|
||
strict_equality = True | ||
|
||
exclude = (^setup\.py$) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/env python | ||
|
||
# Dependencies | ||
from setuptools import setup | ||
|
||
raise Exception("Please make sure you have modified all necessary attributes before pip installing the package") | ||
|
||
setup( | ||
name="rdock-utils", | ||
version="0.01", | ||
description="", | ||
author="", | ||
author_email="", | ||
url="", | ||
packages=[], | ||
# inlcude_package_data=True, | ||
# package_data={'package.module':[folder/with/data/*]} | ||
# scripts=[], | ||
install_requires=[], | ||
) |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# An empty test, to be able to run something with pytest : ) | ||
# Remove me when you have something in place | ||
|
||
|
||
def test_all_ok() -> None: | ||
assert True |