Development Install¤
In order to develop applications or projects derived on devapps
(or on devapps
itself):
- clone this or the derived application's repository
- configure artifactory credentials (for packages referred to in your
pyproject.toml
file) as explained before pip install poetry
if you not yet have the build system (does not need to match your target python version)- run
poetry install
It takes around a minute for poetry to resolve all dependencies.
After this you can enter the virtual environment via poetry shell with all required packages and commands available:
$ poetry shell
$ ops -h
$ poetry shell
Virtual environment already activated: [34m/home/runner/miniconda3/envs/devapps_py3.7
[39m$
$ ops -h
Usage: ops ACTION [--flag[=value] ...]
Available Action Plugins:
- [1m[32mcontainer_build
[0m[39m[49m - [1m[32mcontainer_pull
[0m[39m[49m - [1m[32mfs_build
[0m[39m[49m - [1m[32minfra_aws_cloud
[0m[39m[49m - [1m[32minfra_digital_ocean
[0m[39m[49m - [1m[32minfra_hetzner_cloud
[0m[39m[49m - [1m[32mkubectl
[0m[39m[49m - [1m[32mlife_cycle
[0m[39m[49m - [1m[32mlog_view
[0m[39m[49m - [1m[32mpkgs
[0m[39m[49m - [1m[32mproject
[0m[39m[49m - [1m[32mrun
[0m[39m[49m - [1m[32msystem
[0m[39m[49mHelp:
ops <action> <-h|--helpfull> [match]
Note:
- Action shortcuts understood, e.g. action "foo_bar_baz" = fbb
- Plugins are taken on first found basis
- Flags also have shortcut versions (e.g. -hf for --helpfull)
Example:
ops container_build -hf log # all flags about logging
Co-Developing Dependent Packages¤
If you want to develop not only on the poetry installed package but also on others than using a PYTHONPATH based trick is convenient:
Clone the other repositories under development as well and export $PYTHONPATH
like so:
$ (lc-python-Z3KKTfGL-py3.7) 2.lc-python$ type ldp
ldp is aliased to `export PYTHONPATH="/home/joe/repos/devapps/src:/home/joe/repos/lc-doctools/src"; cd /home/joe/repos/lc-python; poetry shell'
The devapps dependent lc-python
environment will now use e.g. devapps
from the checkout and not from the configured package.
Scripts from cloned repos
The PYTHONPATH trick works also when those other packages ship with scripts, e.g.
the doc
script from lc-doctools
, or ops
from devapps
.
You do need to have at least one version with such a script in your pyproject.yml
,
so that the script is installed and found in your $PATH
within the virtual environment.