Create new, build and install Python Packages from a template
Project description
Framework for managing the scaffolding for new and existing Python Packages.
Use a configuration (.ini) file to: 1. Create the “scaffolding” for a new package. 2. Examine existing scaffolding and add missing components like directories and files. 3. Version control 4. Apply PEP8 via Black 5. Update Git and GitHub 6. Upload to PyPi 7. PEP12 doc strings 8. Create a virtual environment for the project 9. Special thanks to Jacob Tomlinson. This application is based on his article Creating an open source Python project from scratch. 10. Configurations through templates which are easier to change. 11. Step-by-step procedure for beginners as well as connoisseurs. Intention was educational, but also functional. This is a starting block to create the initial structure that can be used to grow it bigger. ToDo 1. Silence the scripting implementations and write output to log file. 2. Write the number of tests and time to the ini and then add it to the readme.rst 3. Warning in documentation about Dropbox grabbing files 4. Upfront tasks 4.1 Create the following accounts - Github - ReadTheDocs https://docs.readthedocs.io/en/stable/tutorial/ - CodeCov 5. Discuss the usage of templates i.e. where the default templates are and how to use a custom template. 6. Rename all the templates and read the template name from the pimt.ini 7. Read the module | package setting from the commandline rather than the ini file. Reading it from the ini forces the creation off 2 ini files, one for packages and the other for modules 8. Check if it is necessary for the pre-commit onto run before CI process on GitHUb and fix if necessary. 9. Add Black-badge https://black.readthedocs.io/en/stable/ Documentation 1. Tokens - GitHUb - ReadTheDocs 2. Runs the system without human intervention i.e. a GUI interface. No GUI, questions. All through setting up the ini and templates. - Templates gives opportunity to add own requirements and changes. - Changes in (version) applications using the templates can also be more easily accommodated. - User can configure his/her own templates and leave the defaults intact. 3. You cannot delete a project on ReadTheDOcs via API. To properly run the tests the TestProject you are creating must be deleted manually on ReadTheDocs 4. PackageIt must tun in a virtual environment 5. All packages and modules created by PackageIt must run in a virtual environment. Conventions 1. Release note title name = “Ver n.n.n” 2. Release tag name = “Tag n.n.n’ 3. GitHub enhancement branch name = “Enhancement_nnnn” where nnnn is the GitHub issue number with leading zeros. 4. Color Coding - Yellow is informational i.e. contents of batch fields - Purple is is mile stone messages - White is messages by 3rd party API’s - Red - Warning or error messages Testing 1. Virtual Environments: PackageIt rely on virtual environments and also assume (default) any creation of a new module.package/library will be in a virtual environment. By convention each of the tests should therefore run in it’s own freshly created virtual environment. This is unfortunately and expectedly become very expensive. PackageIt there fore applies the following strategy with regards to testing: - It (obviously) assume the PackageIt.create_venv work correctly and is tested properly. - Tests rely on the virtual environment installed for PackageIt. - Fresh virtual environments will only be created if: - The test or any methods it calls will alter the virtual environment or - It requires to operate specifically in the virtual environment for the package begin created.
Testing
This project uses pytest to run tests and also to test docstring examples.
Install the test dependencies.
$ pip install -r requirements_test.txt
Run the tests.
$ pytest tests
=== XXX passed in SSS seconds ===
Developing
This project uses black to format code and flake8 for linting. We also support pre-commit to ensure these have been run. To configure your local environment please install these development dependencies and set up the commit hooks.
$ pip install black flake8 pre-commit
$ pre-commit install
Releasing
Releases are published automatically when a tag is pushed to GitHub.
# Set next version number
export RELEASE = x.x.x
# Create tags
git commit --allow -empty -m "Release $RELEASE"
git tag -a $RELEASE -m "Version $RELEASE"
# Push
git push upstream --tags
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for PackageIt-3.1.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 884fc143d765029c1793b8d62140f3db6253927d44bb02dab5a9c58ee09b0df6 |
|
MD5 | 35213b81e5b2767465575ea10c0e6344 |
|
BLAKE2b-256 | ae31bcf003269ada0efd89aea6a75665cc6feed6c883e19d701917b578c6c46f |