58 lines
1.2 KiB
Markdown
58 lines
1.2 KiB
Markdown
# CoreLibs for Python
|
|
|
|
This is a pip package that can be installed into any project and covers the following pars
|
|
|
|
- logging update with exception logs
|
|
- requests wrapper for easier auth pass on access
|
|
- dict fingerprinting
|
|
- jmespath search
|
|
- dump outputs for data
|
|
- progress printing
|
|
|
|
## How to publish
|
|
|
|
Have the following setup in `project.toml`
|
|
|
|
```toml
|
|
[[tool.uv.index]]
|
|
name = "egra-gitea"
|
|
url = "https://git.egplusww.jp/api/packages/PyPI/pypi/simple/"
|
|
publish-url = "https://git.egplusww.jp/api/packages/PyPI/pypi"
|
|
explicit = true
|
|
```
|
|
|
|
```sh
|
|
uv build --native-tls
|
|
uv publish --index egra-gitea --token <gitea token> --native-tls
|
|
```
|
|
|
|
## Test package
|
|
|
|
We must set the full index URL here because we run with "--no-project2
|
|
|
|
```sh
|
|
uv run --with corelibs --index egra-gitea=https://git.egplusww.jp/api/packages/PyPI/pypi/simple/ --no-project --native-tls -- python -c "import corelibs"
|
|
```
|
|
|
|
## How to install in another project
|
|
|
|
This will also add the index entry
|
|
|
|
```sh
|
|
uv add corelibs --index egra-gitea=https://git.egplusww.jp/api/packages/PyPI/pypi/simple/ --native-tls
|
|
```
|
|
|
|
## Python venv setup
|
|
|
|
In the folder where the script will be located
|
|
|
|
```sh
|
|
uv venv --python 3.13
|
|
```
|
|
|
|
Install all neded dependencies
|
|
|
|
```sh
|
|
uv sync
|
|
```
|