herostools 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,177 @@
1
+ uv.lock
2
+
3
+ .gitlab-ci-local/
4
+
5
+ # Byte-compiled / optimized / DLL files
6
+ __pycache__/
7
+ *.py[cod]
8
+ *$py.class
9
+
10
+ # C extensions
11
+ *.so
12
+
13
+ # Distribution / packaging
14
+ .Python
15
+ build/
16
+ develop-eggs/
17
+ dist/
18
+ downloads/
19
+ eggs/
20
+ .eggs/
21
+ lib/
22
+ lib64/
23
+ parts/
24
+ sdist/
25
+ var/
26
+ wheels/
27
+ share/python-wheels/
28
+ *.egg-info/
29
+ .installed.cfg
30
+ *.egg
31
+ MANIFEST
32
+
33
+ # PyInstaller
34
+ # Usually these files are written by a python script from a template
35
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
36
+ *.manifest
37
+ *.spec
38
+
39
+ # Installer logs
40
+ pip-log.txt
41
+ pip-delete-this-directory.txt
42
+
43
+ # Unit test / coverage reports
44
+ htmlcov/
45
+ .tox/
46
+ .nox/
47
+ .coverage
48
+ .coverage.*
49
+ .cache
50
+ nosetests.xml
51
+ coverage.xml
52
+ *.cover
53
+ *.py,cover
54
+ .hypothesis/
55
+ .pytest_cache/
56
+ cover/
57
+ report.xml
58
+ cobertura.xml
59
+
60
+ # Translations
61
+ *.mo
62
+ *.pot
63
+
64
+ # Django stuff:
65
+ *.log
66
+ local_settings.py
67
+ db.sqlite3
68
+ db.sqlite3-journal
69
+
70
+ # Flask stuff:
71
+ instance/
72
+ .webassets-cache
73
+
74
+ # Scrapy stuff:
75
+ .scrapy
76
+
77
+ # Sphinx documentation
78
+ docs/_build/
79
+
80
+ # PyBuilder
81
+ .pybuilder/
82
+ target/
83
+
84
+ # Jupyter Notebook
85
+ .ipynb_checkpoints
86
+
87
+ # IPython
88
+ profile_default/
89
+ ipython_config.py
90
+
91
+ # pyenv
92
+ # For a library or package, you might want to ignore these files since the code is
93
+ # intended to run in multiple environments; otherwise, check them in:
94
+ # .python-version
95
+
96
+ # pipenv
97
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
98
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
99
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
100
+ # install all needed dependencies.
101
+ #Pipfile.lock
102
+
103
+ # UV
104
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
105
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
106
+ # commonly ignored for libraries.
107
+ #uv.lock
108
+
109
+ # poetry
110
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
111
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
112
+ # commonly ignored for libraries.
113
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
114
+ #poetry.lock
115
+
116
+ # pdm
117
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
118
+ #pdm.lock
119
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
120
+ # in version control.
121
+ # https://pdm.fming.dev/latest/usage/project/#working-with-version-control
122
+ .pdm.toml
123
+ .pdm-python
124
+ .pdm-build/
125
+
126
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
127
+ __pypackages__/
128
+
129
+ # Celery stuff
130
+ celerybeat-schedule
131
+ celerybeat.pid
132
+
133
+ # SageMath parsed files
134
+ *.sage.py
135
+
136
+ # Environments
137
+ .env
138
+ .venv
139
+ env/
140
+ venv/
141
+ ENV/
142
+ env.bak/
143
+ venv.bak/
144
+
145
+ # Spyder project settings
146
+ .spyderproject
147
+ .spyproject
148
+
149
+ # Rope project settings
150
+ .ropeproject
151
+
152
+ # mkdocs documentation
153
+ /site
154
+
155
+ # mypy
156
+ .mypy_cache/
157
+ .dmypy.json
158
+ dmypy.json
159
+
160
+ # Pyre type checker
161
+ .pyre/
162
+
163
+ # pytype static type analyzer
164
+ .pytype/
165
+
166
+ # Cython debug symbols
167
+ cython_debug/
168
+
169
+ # PyCharm
170
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
171
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
172
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
173
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
174
+ #.idea/
175
+
176
+ # PyPI configuration file
177
+ .pypirc
@@ -0,0 +1,170 @@
1
+ image: "python:slim"
2
+
3
+ stages:
4
+ - test
5
+ - pages
6
+ - build-package
7
+ - publish-package
8
+ - publish-docker
9
+
10
+ variables:
11
+ PACKAGE_NAME: "herostools"
12
+ PYPI_URL: "https://gitlab.com/api/v4/projects/${CI_PROJECT_ID}/packages/pypi"
13
+
14
+
15
+ ####################################
16
+ # build script for docker images
17
+ .build-docker-image:
18
+ image: quay.io/buildah/stable
19
+ variables:
20
+ IMAGE_TAG: "latest"
21
+ BUILDAH_FORMAT: docker
22
+ STORAGE_DRIVER: vfs
23
+ tags:
24
+ - docker
25
+ before_script:
26
+ - echo "$CI_REGISTRY_PASSWORD" | buildah login -u "$CI_REGISTRY_USER" --password-stdin $CI_REGISTRY
27
+ script:
28
+ - cd "${CI_PROJECT_DIR}"
29
+ - buildah build --platform=linux/arm64/v8,linux/amd64 --manifest "${CI_REGISTRY_IMAGE}:${TAG_NAME}" .
30
+ - buildah tag "${CI_REGISTRY_IMAGE}:${TAG_NAME}" "${CI_REGISTRY_IMAGE}:latest"
31
+ - buildah manifest push --all "${CI_REGISTRY_IMAGE}:${TAG_NAME}"
32
+ - buildah manifest push --all "${CI_REGISTRY_IMAGE}:latest"
33
+ - buildah build --platform=linux/arm64/v8 --build-arg VARIANT=rpi --manifest "${CI_REGISTRY_IMAGE}:${TAG_NAME}-rpi" .
34
+ - buildah tag "${CI_REGISTRY_IMAGE}:${TAG_NAME}-rpi" "${CI_REGISTRY_IMAGE}:latest-rpi"
35
+ - buildah manifest push --all "${CI_REGISTRY_IMAGE}:${TAG_NAME}-rpi"
36
+ - buildah manifest push --all "${CI_REGISTRY_IMAGE}:latest-rpi"
37
+
38
+
39
+ ####################################
40
+ # publish script for pypi packages
41
+ .publish-package-to-repo:
42
+ stage: publish-package
43
+ tags:
44
+ - docker
45
+ image: "quay.io/pypa/manylinux_2_28_x86_64"
46
+ needs: ["build-package"] # Ensure package is built before publishing
47
+ before_script:
48
+ - pipx install twine
49
+
50
+
51
+ ####################################
52
+ # build
53
+ build-package:
54
+ stage: build-package
55
+ tags:
56
+ - docker
57
+ parallel:
58
+ matrix:
59
+ - IMAGE: ["quay.io/pypa/manylinux_2_28_x86_64"]
60
+ image: $IMAGE
61
+ script:
62
+ - pipx install hatch
63
+ - hatch build # Builds source tarball and wheel
64
+ artifacts:
65
+ paths:
66
+ - dist/
67
+ rules:
68
+ - if: '$CI_JOB_TRIGGER == "boss"'
69
+ when: never
70
+ - when: always
71
+
72
+
73
+ ####################################
74
+ # test
75
+ pytest:
76
+ stage: test
77
+ tags:
78
+ - docker
79
+ script:
80
+ - pip install --upgrade uv
81
+ - uv venv
82
+ - uv pip install -e .[dev]
83
+ - uv run pytest --color=yes --junitxml=report.xml --cov-report html --cov-report term --cov-report xml:cobertura.xml --cov=src/ tests/
84
+ coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
85
+ artifacts:
86
+ paths:
87
+ - htmlcov
88
+ - report.xml
89
+ - cobertura.xml
90
+ reports:
91
+ junit: report.xml
92
+ coverage_report:
93
+ coverage_format: cobertura
94
+ path: cobertura.xml
95
+ rules:
96
+ - if: '$CI_JOB_TRIGGER == "boss"'
97
+ when: never
98
+ - if: $CI_PIPELINE_SOURCE == "merge_request_event"
99
+ - if: $CI_COMMIT_BRANCH == "main"
100
+ allow_failure: true
101
+
102
+
103
+ ####################################
104
+ # lint
105
+ ruff:
106
+ stage: test
107
+ tags:
108
+ - docker
109
+ script:
110
+ - pip install --upgrade uv
111
+ - uv venv
112
+ - uv pip install -e .[dev]
113
+ - uv run ruff check
114
+ rules:
115
+ - if: '$CI_JOB_TRIGGER == "boss"'
116
+ when: never
117
+ - if: $CI_PIPELINE_SOURCE == "merge_request_event"
118
+ - if: $CI_COMMIT_BRANCH == "main"
119
+
120
+
121
+ ####################################
122
+ # publish package
123
+ publish-package-gitlab:
124
+ stage: publish-package
125
+ extends: .publish-package-to-repo
126
+ script:
127
+ - twine upload --repository-url "$PYPI_URL" -u "gitlab-ci-token" -p "$CI_JOB_TOKEN" dist/*
128
+ rules:
129
+ - if: '$CI_JOB_TRIGGER == "boss"'
130
+ when: never
131
+ - if: '$CI_COMMIT_BRANCH == "main"'
132
+ when: on_success
133
+
134
+
135
+ ####################################
136
+ # docker image git commit sha with last commit from main (not on tag)
137
+ publish-docker-main:
138
+ stage: publish-docker
139
+ extends: .build-docker-image
140
+ variables:
141
+ TAG_NAME: "$CI_COMMIT_SHORT_SHA"
142
+ rules:
143
+ - if: '$CI_COMMIT_REF_NAME == "main"'
144
+ - if: '$CI_PIPELINE_SOURCE == "pipeline"'
145
+
146
+
147
+ ####################################
148
+ # publish pages
149
+ pages:
150
+ stage: pages
151
+ tags:
152
+ - docker
153
+ script:
154
+ - apt-get update && apt-get install -y make
155
+ - pip install --upgrade uv
156
+ - uv venv
157
+ - uv pip install -e .[docs]
158
+ - cd docs
159
+ - uv run make clean && uv run make html
160
+ - mkdir ../public
161
+ - mv build/html/* ../public
162
+ artifacts:
163
+ paths:
164
+ - public
165
+ rules:
166
+ - if: '$CI_JOB_TRIGGER == "boss"'
167
+ when: never
168
+ - if: '$CI_COMMIT_BRANCH == "main"'
169
+ when: on_success
170
+
@@ -0,0 +1,39 @@
1
+ repos:
2
+ - repo: local
3
+ hooks:
4
+ - id: ruff-check
5
+ name: Ruff Linter
6
+ language: python
7
+ types: [python]
8
+ entry: ruff check --fix
9
+ require_serial: true
10
+ stages: [pre-commit, pre-push, manual]
11
+ - id: ruff-format
12
+ name: Ruff Formatter
13
+ language: python
14
+ types: [python]
15
+ entry: ruff format
16
+ require_serial: true
17
+ stages: [pre-commit, pre-push, manual]
18
+ - id: codespell
19
+ name: Find Spelling Errors
20
+ language: python
21
+ entry: codespell
22
+ stages: [pre-commit, pre-push, manual]
23
+ additional_dependencies: [codespell]
24
+ - id: mypy
25
+ name: MyPy Typing and more
26
+ language: python
27
+ types: [python]
28
+ entry: mypy
29
+ stages: [manual]
30
+ additional_dependencies: [mypy]
31
+ - repo: https://github.com/pre-commit/pre-commit-hooks
32
+ rev: v4.2.0
33
+ hooks:
34
+ - id: check-ast
35
+ - id: check-added-large-files
36
+ - id: check-docstring-first
37
+ - id: detect-private-key
38
+ - id: trailing-whitespace
39
+
@@ -0,0 +1,13 @@
1
+ # #########################################################################################
2
+ # Build image with everything required to run the tools
3
+ # #########################################################################################
4
+
5
+ FROM registry.gitlab.com/atomiq-project/boss
6
+
7
+ # Copy the contents of the repository into the image
8
+ WORKDIR /git
9
+ COPY . herostools
10
+
11
+ # Install herostools in editable mode
12
+ RUN pip install --break-system-packages -e herostools
13
+