Skip to content

Commit 6c6f1d6

Browse files
Merge pull request #1 from InformaticsMatters/updates
Updates
2 parents be291a6 + e45c053 commit 6c6f1d6

File tree

13 files changed

+940
-20
lines changed

13 files changed

+940
-20
lines changed

.github/workflows/build.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ on:
2626
tags-ignore:
2727
- '**'
2828

29+
env:
30+
POETRY_VERSION: 1.8.3
31+
2932
jobs:
3033
build:
3134
runs-on: ubuntu-latest
@@ -40,8 +43,11 @@ jobs:
4043
python-version: '3.10'
4144
- name: Install dependencies
4245
run: |
43-
python -m pip install --upgrade pip
44-
pip install -r build-requirements.txt
46+
python -m pip install --no-cache-dir poetry==${POETRY_VERSION}
47+
POETRY_VIRTUALENVS_CREATE=false poetry install --only dev --no-root --no-directory
48+
- name: Run pre-commit (all files)
49+
run: |
50+
pre-commit run --all-files
4551
- name: Login to DockerHub
4652
uses: docker/login-action@v3
4753
with:

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,7 @@
22
.idea
33
data-manager/jote
44
venv
5+
6+
*~
7+
\#*#
8+
\#*

.mypy.ini

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[mypy]
2+
#ignore_missing_imports = True
3+
4+
#[mypy-viewer.*]
5+
#disallow_untyped_defs = False
6+
#disallow_untyped_calls = False
7+
#check_untyped_defs = True

.pre-commit-config.yaml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
minimum_pre_commit_version: 3.6.0
2+
3+
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v4.6.0
6+
hooks:
7+
- id: check-case-conflict
8+
- id: check-docstring-first
9+
- id: check-executables-have-shebangs
10+
- id: check-shebang-scripts-are-executable
11+
- id: check-merge-conflict
12+
- id: detect-private-key
13+
- id: end-of-file-fixer
14+
- id: check-toml
15+
- id: check-yaml
16+
- id: check-json
17+
- id: trailing-whitespace
18+
args:
19+
- --markdown-linebreak-ext=md
20+
21+
# isort
22+
- repo: https://github.com/pycqa/isort
23+
rev: 5.13.2
24+
hooks:
25+
- id: isort
26+
args:
27+
- --profile
28+
- black
29+
- --filter-files
30+
31+
# Black
32+
- repo: https://github.com/psf/black
33+
rev: 24.8.0
34+
hooks:
35+
- id: black
36+
args:
37+
- --target-version
38+
- py311
39+
40+
# MyPy
41+
- repo: https://github.com/pre-commit/mirrors-mypy
42+
rev: v1.11.1
43+
hooks:
44+
- id: mypy
45+
46+
# Pylint
47+
- repo: https://github.com/pycqa/pylint
48+
rev: v3.2.6
49+
hooks:
50+
- id: pylint
51+
args: [src,]

.pylintrc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[messages control]
2+
3+
# Disable some distracting checks.
4+
# See http://pylint.pycqa.org/en/latest/user_guide/message-control.html
5+
#
6+
# C : Convention warnings
7+
# R : Refactoring warnings
8+
disable = C, F, R,
9+
bare-except,
10+
broad-exception-caught,
11+
broad-exception-raised,
12+
fixme,
13+
import-error,

DEVELOPER-README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,9 @@ ARM64 (Apple M1) processors, so we use Docker's [buildx] to build the image: -
1111
--tag informaticsmatters/data-manager-job-operator:latest
1212

1313
## Testing
14-
With the image built, use the Job tester utility: -
14+
With the image built, activate the environment: -
1515

16-
python -m pip install --upgrade pip
17-
python -m pip install -r build-requirements.txt
16+
poetry shell
1817

1918
And, from the project root, run the tester: -
2019

Dockerfile

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,32 @@
1-
FROM python:3.11.5-alpine3.18
1+
FROM python:3.11.5-alpine3.18 as python-base
22

33
ENV PYTHONUNBUFFERED=1
44
ENV HOME=/code
55

6-
COPY requirements.txt /tmp/
7-
RUN pip install -r /tmp/requirements.txt
6+
7+
# another stage for poetry installation. this ensures poetry won't end
8+
# up in final image where it's not needed
9+
FROM python-base AS poetry-base
10+
11+
ARG POETRY_VERSION=1.8.3
12+
RUN pip install --no-cache-dir poetry==${POETRY_VERSION}
13+
14+
WORKDIR /
15+
COPY poetry.lock pyproject.toml /
16+
17+
RUN POETRY_VIRTUALENVS_IN_PROJECT=true poetry install --no-root --only main --no-directory
18+
19+
20+
21+
# final stage. only copy the venv with installed packages and point
22+
# paths to it
23+
FROM python-base as final
24+
25+
COPY --from=poetry-base /.venv /.venv
26+
27+
ENV PYTHONPATH="${PYTHONPATH}:/.venv/lib/python3.11/site-packages/"
28+
ENV PATH=/.venv/bin:$PATH
29+
830

931
WORKDIR ${HOME}
1032
COPY src/ ./

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,15 @@ From a fork you should be able to build and run the tests for the example
3333
Job that it defines, start with this, and you'll know you're starting with
3434
a working framework: -
3535

36-
python -m venv venv
37-
source venv/bin/activate
38-
python -m pip install -r build-requirements.txt
36+
poetry shell
37+
poetry install --no-root
38+
39+
pre-commit install -t commit-msg -t pre-commit
3940

4041
docker-compose build
4142
jote
4243

43-
deactivate
44+
deactivate
4445

4546
> Note: You MUST provide at least one test for every Job your repository
4647
defines, and you MUST use our Job Tester ([im-jote]) to run those tests -

build-requirements.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)