namespace portions documentation
welcome to the documentation of the portions (modules and packages) of this freely extendable aedev namespace (PEP 420).
features and use-cases
the portions of this namespace are simplifying your Python application or service in the areas/domains:
continuous integration
continuous deployment
managed files (generated/renewed from template projects)
code and config file templates
git repository management (locally and remotely)
software development
software testing and QA
code maintenance guidelines
portions code features
open source
pure python
fully typed (PEP 526)
fully documented
100 % test coverage
multi thread save
code checks (using pylint and flake8)
design pattern and software principles
contributing
we want to make it as easy and fun as possible for you to contribute to this project.
reporting bugs
before you create a new issue, please check to see if you are using the latest version of this project; the bug may already be resolved.
also search for similar problems in the issue tracker; it may already be an identified problem.
include as much information as possible into the issue description, at least:
version numbers (of Python and any involved packages).
small self-contained code example that reproduces the bug.
steps to reproduce the error.
any traceback/error/log messages shown.
requesting new features
on the git repository host server create new issue, providing a clear and detailed explanation of the feature you want and why it’s important to add.
if you are able to implement the feature yourself (refer to the contribution steps section below).
contribution steps
thanks for your contribution – we’ll get your merge request reviewed. you could also review other merge requests, just like other developers will review yours and comment on them. based on the comments, you should address them. once the reviewers approve, the maintainers will merge.
before you start make sure you have a GitLab account.
contribution can be done either with the project-manager tool or directly by using
the git command and the Gitlab server.
using the project manager tool pjm
fork and clone the repository of this project to your computer
in your console change the working directory to your project’s parent folder. then run the following command:
pjm fork aedev-group/aedev_aedev
Note
the
pjm forkaction will also add the forked repository as theupstreamremote to your local repository.now change your current working directory to the new working-tree|project root folder, created by the
pjm forkaction, and execute thepjm renewaction with thenew_feature_or_fixpart replaced by an appropriate branch name, describing shortly the new feature or the bug-fix of your contribution:pjm -b new_feature_or_fix renew
this will prepare a new release version of the project and upgrade the project files created from templates to its latest version.
code and check
now use your favorite IDE/Editor to implement the new feature or code the bug fix. don’t forget to amend the project with new unit and integrity tests, and ensure they pass, by executing from time to time the
pjm checkaction.publish your changes
before you initiate a push/merge request against the Gitlab server, execute the
pjm prepareaction, which will create, with the help of thegit diffcommand, a .commit_msg.txt file in the working tree root of your project, containing a short summary in the first line followed with a blank line and a list of the project files that got added, changed or deleted.Hint
the .commit_msg.txt file can be amended by any text editor before you run the
pjm commitaction. for changes initiated by an issue please include the issue number (in the formatfixes #<issue-number>) into this file. you may useMarkdownsyntax in this file for simple styling.to finally commit and upload your changes run the following three pjm actions in the root folder of your project:
pjm commit pjm push pjm request
the
pjm commitcommand is first executing apjm checkaction to do a finally check of the project resources and to run the unit and integrity tests. if all these checks pass then a new git commit will be created, including your changes to the project.pjm push``will then push the commit to your ``originremote repository (your fork) andpjm requestwill finally create a bew merge/pull request against theupstreamremote repository (the forked one).Hint
to complete the workflow a maintainer of the project has to execute the
pjm releaseaction. this will merge your changes into the main branch develop of theupstreamrepository and then release a new version of the project onto PyPI.
more detailed information of the features of the pjm tool are available within the pjm user manual.
using git and Gitlab
alternatively to the pjm tool you could directly use the git command suite and the
Gitlab website to achieve the same (with a lot more of typing and fiddling ;-):
fork the upstream repository into your user account.
clone your forked repo as
originremote to your computer, and add anupstreamremote for the destination repo by running the following commands in the console of your local machine:git clone https://gitlab.com/<YourGitLabUserName>/aedev_aedev.git git remote add upstream https://gitlab.com/aedev-group/aedev_aedev.git
checkout out a new local feature branch and update it to the latest version of the
developbranch:git checkout -b <new_feature_or_fix_branch_name> develop git pull --rebase upstream develop
please keep your code clean by staying current with the
developbranch, where code will be merged. if you find another bug, please fix it in a separated branch instead.push the branch to your fork. treat it as a backup:
git push origin <new_feature_or_fix_branch_name>
code
implement the new feature or the bug fix; include tests, and ensure they pass.
check
run the basic code style and typing checks locally (pylint, mypy and flake8) before you commit.
commit
for every commit please write a short summary in the first line followed with a blank line and then more detailed descriptions of the change. for bug fixes please include any issue number (in the format #nnn) in your summary:
git commit -m "issue #123: put change summary here (can be a issue title)"
Note
never leave the commit message blank! provide a detailed, clear, and complete description of your changes!
publish your changes (prepare a Merge Request)
before submitting a merge request, update your branch to the latest code:
git pull --rebase upstream develop
if you have made many commits, we ask you to squash them into atomic units of work. most issues should have one commit only, especially bug fixes, which makes them easier to back port:
git checkout develop git pull --rebase upstream develop git checkout <new_feature_or_fix_branch_name> git rebase -i develop
push changes to your fork:
git push -f
issue/make a GitLab Merge Request:
navigate to your fork where you just pushed to
click Merge Request
in the branch field write your feature branch name (this is filled with your default branch name)
click Update Commit Range
ensure the changes you implemented are included in the Commits tab
ensure that the Files Changed tab incorporate all of your changes
fill in some details about your potential patch including a meaningful title
click New merge request.
release to PyPI
the release of a new/changed project will automatically be initiated by the GitLab CI, using the two
protected vars PYPI_USERNAME and PYPI_PASSWORD (marked as masked) from the users group of this namespace, in
order to provide the user name and password of the maintainers PyPI account (on Gitlab.com at Settings/CI_CD/Variables).
useful links and resources
pjm (project-manager) tool project
project repositoryand user manual
create new namespace
a PEP 420 namespace splits the codebase of a library or framework into multiple project repositories, called portions (of the namespace).
Hint
the aedev namespace is providing the project-manager (pjm) tool to create and maintain namespace root and its portion projects.
the id of a new namespace has to be available on PyPI.
the owner name of your namespace (group-name) has to be available on your
git repository server. it defaults to the namespace name plus the suffix '-group'.
register a new namespace portion
follow the steps underneath to add and register a new module portion onto the aedev namespace:
open a console window and change the current directory to the parent directory of your projects root folders.
choose a not-existing/unique name for the new portion (referred as <portion-name> in the next steps).
run
pjm --namespace_name=aedev --project_name=aedev_<portion_name> new_moduleto create a new project folder aedev_<portion-name>, and to register the portion name within the namespace.run
cd aedev_<portion-name>to change the current to the working tree root of the new portion project. within the project folder you will find the initial project files created from templates and a pre-configured git repository (with the remote already set and the initial files unstaged, to be extended, staged and finally committed).optionally run pyenv local venv_name (or any other similar tool) to create/prepare a local virtual environment.
fans of TDD are then coding unit tests in the prepared test module test_aedev_<portion-name>.py, situated within the tests sub-folder of your new code project folder.
extend the file <portion_name>.py situated in the aedev sub-folder to implement the new portion.
run
pjm check-integrityto run the linting and unit tests (if they fail go one or two steps back).run
pjm prepare, then amend the commit message within the file .commit_msg.txt and runpjm commit.
the registration of a new portion to the aedev namespace has to
be done by a namespace maintainer. if you have a maintainer role in the
namespace owner group aedev-group (at https://gitlab.com/aedev-group) then you can push and
merge the new portion directly (running pjm push and pjm request).
otherwise contact one of the maintainers to add it for you.
registered portions will automatically be included into the aedev namespace documentation, available at ReadTheDocs.
registered namespace package portions
the following list contains all registered portions of the aedev namespace, plus additional modules of each portion.
Hint
a not on the ordering: portions with no dependencies are at the begin of the following list. the portions that are depending on other portions of the aedev namespace are listed more to the end.
managed Python project files templates |
|
aedev_app_tpls module main module |
|
templates (managed files) for namespace root projects. |
|
base development constants and helpers |
|
software development operation commands helpers |
|
project development variables |
|
maintain Python projects locally and remotely |
|
Python Project Manager |
|
util/helper functions needed by __main__.py and templates.py. |
|
helpers to access codeberg.org via its V1 API |
|
templates for managed files of Python projects |
manuals and tutorials
indices and tables
aenamespace projects and documentationaedevnamespace projects and documentation