Skip to main content

Create new, build and install Python Packages from a template

Project description

PyPI - Status PyPI - Wheel PyPI - Python Version GitHub release (latest by date) License GitHub issues PyPI - Downloads GitHub Searches CodeCov GitHub Actions - Pre-Commit GitHub Actions - CI PyPi

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 APIs - 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

PackageIt-3.1.7.tar.gz (23.4 kB view hashes)

Uploaded Source

Built Distribution

PackageIt-3.1.7-py3-none-any.whl (24.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page