BstLabs / py-dynacli

DynaCLI is a cloud-friendly Python library for converting pure Python functions into Linux Shell commands.
https://bstlabs.github.io/py-dynacli/
MIT License
98 stars 5 forks source link

[FEATURE] dynacli to support complete package/install/deliver lifecycle #88

Open asterkin opened 2 years ago

asterkin commented 2 years ago

Is your feature request related to a problem? Please describe. Making a new cli tool working locally is one thing, packaging, installing and uploading to pypi is completely different level of complexity

Describe the solution you'd like dynacli init generates initial package skeleton dynacli deps add/remove/update (update mb for version) dynacli package should create installation packaging with properly modified search paths dynacli install will install it locally dynacli deliver ... will deploy it to pypi

Describe alternatives you've considered To continue doing it manually

Additional context See also request for command/feature management and testing

ShahriyarR commented 2 years ago
  1. For dynacli deliver: This is automatically done in Github actions - CI. The trigger for this publish job is a newly created version tag from the main branch. The flow:

    • All new features, bug fixes are collected in develop branch
    • The release PR is going to open from develop to main branch with version bump of the dynacli
    • After merging to the main branch - the maintainer of the repo should create a new version tag equal to the new dynacli tool version.
    • After creating the tag - the CI will prepare the pypi package:
    • As we use flit for package management - it is only single command flit publish - it will build, prepare the production package and upload to PyPI. The PyPi auth token will be taken from secrets during CI.
    1. For dynacli install:

      • As we use flit, local development install is going to be simply flit install --python=python3.9 --symlink, if you have to say Python 3.8 just change the python version accordingly. --symlink makes sure that when you change the source code and hit save it will be automatically available without the need for repeated installation.
    2. Did not get the idea of dynacli deps you mean the dependency management? We use pyproject.toml as the modern way of tracking dev/test/prod dependencies. When we do flit install it will install everything, when the flit publish it will prepare the prod version. If somebody wants a more sophisticated dependency manager, he/she should go with poetry.

    If you mean, we should provide such functionality on our site. , for me, this is redundant. If somebody has created a library with dynacli - it is really on their responsibility to package, publish, their work etc.

asterkin commented 2 years ago

I would distinguish between cli and CI/CD. Github action could run dynacli deliver, but IMHO the solution should be internal (what if somebody uses another git server?) With rgeard to deps, dynacli deps IMHO creates/updates pyproject.toml.