feat: move package registry to nexus
This commit is contained in:
parent
cf91189728
commit
527a671a75
@ -5,7 +5,7 @@ default_language_version:
|
|||||||
python: python3.10
|
python: python3.10
|
||||||
repos:
|
repos:
|
||||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
rev: v4.6.0
|
rev: v5.0.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: trailing-whitespace
|
- id: trailing-whitespace
|
||||||
- id: end-of-file-fixer
|
- id: end-of-file-fixer
|
||||||
@ -39,7 +39,7 @@ repos:
|
|||||||
- --profile black
|
- --profile black
|
||||||
|
|
||||||
- repo: https://github.com/psf/black
|
- repo: https://github.com/psf/black
|
||||||
rev: 24.4.2
|
rev: 24.10.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: black
|
- id: black
|
||||||
# exclude: ^(docs/|notebooks/|data/|src/secrets/)
|
# exclude: ^(docs/|notebooks/|data/|src/secrets/)
|
||||||
@ -47,7 +47,7 @@ repos:
|
|||||||
- --line-length=120
|
- --line-length=120
|
||||||
|
|
||||||
- repo: https://github.com/compilerla/conventional-pre-commit
|
- repo: https://github.com/compilerla/conventional-pre-commit
|
||||||
rev: v3.2.0
|
rev: v3.6.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: conventional-pre-commit
|
- id: conventional-pre-commit
|
||||||
pass_filenames: false
|
pass_filenames: false
|
||||||
|
|||||||
11
README.md
11
README.md
@ -73,6 +73,17 @@ the [complete example](pyinfra/examples.py).
|
|||||||
| TRACING\_\_OPENTELEMETRY\_\_EXPORTER | tracing.opentelemetry.exporter | Name of exporter |
|
| TRACING\_\_OPENTELEMETRY\_\_EXPORTER | tracing.opentelemetry.exporter | Name of exporter |
|
||||||
| KUBERNETES\_\_POD_NAME | kubernetes.pod_name | Service pod name |
|
| KUBERNETES\_\_POD_NAME | kubernetes.pod_name | Service pod name |
|
||||||
|
|
||||||
|
## Setup
|
||||||
|
**IMPORTANT** you need to set the following environment variables before running the setup script:
|
||||||
|
- ``$NEXUS_USER`` your Nexus user (usually equal to firstname.lastname@knecon.com)
|
||||||
|
- ``$NEXUS_PASSWORD`` your Nexus password (usually equal to your Azure Login)
|
||||||
|
|
||||||
|
```shell
|
||||||
|
# create venv and activate it
|
||||||
|
source ./scripts/setup/devenvsetup.sh {{ cookiecutter.python_version }} $NEXUS_USER $NEXUS_PASSWORD
|
||||||
|
source .venv/bin/activate
|
||||||
|
```
|
||||||
|
|
||||||
### OpenTelemetry
|
### OpenTelemetry
|
||||||
|
|
||||||
Open telemetry (vis its Python SDK) is set up to be as unobtrusive as possible; for typical use cases it can be
|
Open telemetry (vis its Python SDK) is set up to be as unobtrusive as possible; for typical use cases it can be
|
||||||
|
|||||||
1975
poetry.lock
generated
1975
poetry.lock
generated
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
|||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "pyinfra"
|
name = "pyinfra"
|
||||||
version = "3.3.5"
|
version = "3.4.0"
|
||||||
description = ""
|
description = ""
|
||||||
authors = ["Team Research <research@knecon.com>"]
|
authors = ["Team Research <research@knecon.com>"]
|
||||||
license = "All rights reseverd"
|
license = "All rights reseverd"
|
||||||
@ -18,10 +18,12 @@ azure-storage-blob = "^12.13"
|
|||||||
# misc utils
|
# misc utils
|
||||||
funcy = "^2"
|
funcy = "^2"
|
||||||
pycryptodome = "^3.19"
|
pycryptodome = "^3.19"
|
||||||
# research shared packages
|
|
||||||
kn-utils = { version = "^0.3.2", source = "gitlab-research" }
|
|
||||||
fastapi = "^0.109.0"
|
fastapi = "^0.109.0"
|
||||||
uvicorn = "^0.26.0"
|
uvicorn = "^0.26.0"
|
||||||
|
|
||||||
|
[tool.poetry.group.internal.dependencies]
|
||||||
|
kn-utils = { version = "0.4.0", source = "nexus" }
|
||||||
|
|
||||||
# [tool.poetry.group.telemetry.dependencies]
|
# [tool.poetry.group.telemetry.dependencies]
|
||||||
opentelemetry-instrumentation-pika = "^0.46b0"
|
opentelemetry-instrumentation-pika = "^0.46b0"
|
||||||
opentelemetry-exporter-otlp = "^1.25.0"
|
opentelemetry-exporter-otlp = "^1.25.0"
|
||||||
@ -87,12 +89,13 @@ disable = [
|
|||||||
docstring-min-length = 3
|
docstring-min-length = 3
|
||||||
|
|
||||||
[[tool.poetry.source]]
|
[[tool.poetry.source]]
|
||||||
name = "PyPI"
|
name = "pypi-proxy"
|
||||||
|
url = "https://nexus.knecon.com/repository/pypi-proxy/simple"
|
||||||
priority = "primary"
|
priority = "primary"
|
||||||
|
|
||||||
[[tool.poetry.source]]
|
[[tool.poetry.source]]
|
||||||
name = "gitlab-research"
|
name = "nexus"
|
||||||
url = "https://gitlab.knecon.com/api/v4/groups/19/-/packages/pypi/simple"
|
url = "https://nexus.knecon.com/repository/python/simple"
|
||||||
priority = "explicit"
|
priority = "explicit"
|
||||||
|
|
||||||
[build-system]
|
[build-system]
|
||||||
|
|||||||
39
scripts/setup/devenvsetup.sh
Normal file
39
scripts/setup/devenvsetup.sh
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
python_version=$1
|
||||||
|
nexus_user=$2
|
||||||
|
nexus_password=$3
|
||||||
|
|
||||||
|
# cookiecutter https://gitlab.knecon.com/knecon/research/template-python-project.git --checkout master
|
||||||
|
# latest_dir=$(ls -td -- */ | head -n 1) # should be the dir cookiecutter just created
|
||||||
|
|
||||||
|
# cd $latest_dir
|
||||||
|
|
||||||
|
pyenv install $python_version
|
||||||
|
pyenv local $python_version
|
||||||
|
pyenv shell $python_version
|
||||||
|
|
||||||
|
# install poetry globally (PREFERRED), only need to install it once
|
||||||
|
# curl -sSL https://install.python-poetry.org | python3 -
|
||||||
|
|
||||||
|
# remember to update poetry once in a while
|
||||||
|
poetry self update
|
||||||
|
|
||||||
|
# install poetry in current python environment, can lead to multiple instances of poetry being installed on one system (DISPREFERRED)
|
||||||
|
# pip install --upgrade pip
|
||||||
|
# pip install poetry
|
||||||
|
|
||||||
|
poetry config virtualenvs.in-project true
|
||||||
|
poetry config installer.max-workers 10
|
||||||
|
poetry config repositories.pypi-proxy "https://nexus.knecon.com/repository/pypi-proxy/simple"
|
||||||
|
poetry config http-basic.pypi-proxy ${nexus_user} ${nexus_password}
|
||||||
|
poetry config repositories.nexus https://nexus.knecon.com/repository/python/simple
|
||||||
|
poetry config http-basic.nexus ${nexus_user} ${nexus_password}
|
||||||
|
|
||||||
|
poetry env use $(pyenv which python)
|
||||||
|
poetry install --with=dev
|
||||||
|
poetry update
|
||||||
|
|
||||||
|
source .venv/bin/activate
|
||||||
|
|
||||||
|
pre-commit install
|
||||||
|
pre-commit autoupdate
|
||||||
Loading…
x
Reference in New Issue
Block a user