I have a local package B
which depends on another local package A
. They both are stored in a company repository: https://mycompany.com/api/pypi/pypi-bld/simple
. Therefore, tests of B
requires A
.
I need to use pre-commit which uses both the company repository and the default one.
I use this .pre-commit-config.yaml
, where I have black, pre-commit-hooks, flake8 and init tests:
repos:
- repo: https://github.com/psf/black
some parameters...
- repo: https://github.com/pre-commit/pre-commit-hooks
some parameters...
- repo: https://github.com/pycqa/flake8
some parameters...
- repo: local
hooks:
- id: unittest
name: unittest
entry: python -m unittest discover
language: python
language_version: "3.9"
"types": [python]
pass_filenames: false
stages: [commit]
additional_dependencies: ['--index-url', 'https://<USERNAME>:<PASSWORD>@mycompany.com/api/pypi/pypi-bld/simple',
'requests', 'mylocal-package']
As you can see there is credential information. It is dangerous. So, how to specify in a more clever way? Maybe it is possible to specify a custom pip
from virtualenv
for pre-commit
?