Pyckage Cookiecutter
====================
.. actions building badge
.. image:: https://github.com/zhiwei2017/pyckage-cookiecutter/workflows/Unit%20Test%20&%20Build%20Test/badge.svg
:target: https://github.com/zhiwei2017/pyckage-cookiecutter/actions
.. pypi version badge
.. image:: https://img.shields.io/pypi/v/pyckage-cookiecutter.svg
:target: https://pypi.python.org/pypi/pyckage-cookiecutter/
.. license badge
.. image:: https://img.shields.io/pypi/l/pyckage-cookiecutter.svg
:target: https://pypi.python.org/pypi/pyckage-cookiecutter/
.. python version badge from PyPI
.. image:: https://img.shields.io/pypi/pyversions/pyckage-cookiecutter.svg
:target: https://pypi.python.org/pypi/pyckage-cookiecutter/
:alt: Python 3.8 | Python 3.9 | Python 3.10 | Python 3.11 | Python 3.12
.. pypi format
.. image:: https://img.shields.io/pypi/format/pyckage-cookiecutter.svg
:target: https://badge.fury.io/py/pyckage-cookiecutter
Introduction
------------
This projects consist of a cookiecutter_
template that generates a full structure for a creating a PyPi standard package.
While using this project, you will be asked to provide some inputs such as the author,
the name of the project, etc. As result you will obtain the
complete file and folder structure to quickly start to code your package.
How to Use
----------
Tutorial
++++++++
Let's pretend you want to create a project called "feddit".
By using this template based on cookiecutter_,
you will be able to quickly setup a buildable PyPi package.
First, get cookiecutter_. Trust me, it's awesome::
$ pip install cookiecutter
or with **poetry**::
$ poetry self add cookiecutter
Now run it against this repo::
$ cookiecutter https://github.com/zhiwei2017/pyckage-cookiecutter
or::
$ poetry run cookiecutter https://github.com/zhiwei2017/pyckage-cookiecutter
You'll be prompted for some values. Provide them, then a project will be created for you.
**Warning**: After this point, change '*My Awesome Project*', '*John Doe*', etc to your own information.
Answer the prompts with your own desired `Prompts <https://zhiwei2017.github.io/pyckage-cookiecutter/02_prompts.html>`_. For example::
Cloning into 'pyckage-cookiecutter'...
remote: Enumerating objects: 219, done.
remote: Counting objects: 100% (219/219), done.
remote: Compressing objects: 100% (123/123), done.
remote: Total 219 (delta 83), reused 181 (delta 69), pack-reused 0
Receiving objects: 100% (219/219), 41.09 KiB | 1.71 MiB/s, done.
Resolving deltas: 100% (83/83), done.
[1/8] Select your project name (My Awesome Project):
[2/8] Project URL for hosting the source code. (https://repository-hosting.com/example_project): https://github.com/zhiwei2017/feddit
[3/8] Author full name. (John Doe): John Doe
[4/8] Author email address. (john.doe@email.com): john.doe@example.com
[5/8] Short description. (Behold My Awesome Project!): A fake reddit API.
[6/8] Semantic version to use for release. (0.1.0): 0.1.0
[7/8] Which license do you want to use for your project?
1 - None
2 - MIT
3 - APACHE
4 - 2-Clause BSD
5 - 3-Clause BSD
6 - GPL
Choose from [1/2/3/4/5/6] (1): 2
[8/8] Which CI/CD pipelines do you plan to use?
1 - None
2 - GitHub
3 - GitLab
4 - Bitbucket
Choose from [1/2/3/4] (1): 2
**Please read the comments from README.rst in your project to get to know how to setup the CI/CD pipeline and use commands from Makefile.**
Enter the project and take a look around::
$ cd feddit/
$ ls
Your repo should have the following structure::
feddit
├── .github - github actions configurations
│ └── workflows
│ ├── test.yml - pipelines for linting checks and testing
│ ├── release.yml - pipelines for releases with tags
│ └── sphinx.yml - pipelines for publishing github pages
├── docs - sphinx documentation
│ ├── Makefile - Makefile defines terminal commands for sphinx documentation
│ └── source - documentation source folder
│ ├── 01_about.rst
│ ├── 02_source.rst
│ ├── 03_authors.rst
│ ├── 04_contributing.rst
│ ├── conf.py - sphinx configuration file
│ └── index.rst
├── feddit
│ └── __init__.py
├── tests - tests
│ ├── resources - resources used in tests
│ ├── conftest.py - fixtures in tests
│ └── test_version.py - test version information.
├── .gitignore
├── CONTRIBUTING.rst - contributing guidelines
├── LICENSE
├── Makefile - predefined terminal commands
├── MANIFEST.in - commands, one per line, instructing setuptools to add or remove some set of files from the sdis
├── README.rst - package information
├── setup.cfg - configurations for flake8, since it doesn't support pyproject.toml.
└── pyproject.toml - package configuration file
If you want to use CI/CD pipeline for uploading your package to PyPi, please check the section **CI/CD configuration**.
**Note**:
+ This repo is built as a wheel package and uploaded to `PyPi <https://pypi.python.org/pypi/pyckage-cookiecutter/>`_. You can install it through **pip**::
$ pip install pyckage-cookiecutter
or through **poetry**::
$ poetry self add pyckage-cookiecutter
And start generating a new project by call::
$ pyckage_cookiecutter
or::
$ poetry run pyckage_cookiecutter
The rest is the same as the `Tutorial <#tutorial>`_ introduced.
CI/CD Pipelines
+++++++++++++++
The CI/CD pipelines are predefined in the generated project. Please check following sections for
which steps are included and how to configure them in different platforms.
GitHub Actions
~~~~~~~~~~~~~~
You can find all the configuration files of GitHub Actions in ``.github/workflows`` folder.
Content
:::::::
+-------------+----------------------------------------------+--------------------------------------------------+-----------------------------+-----------------------------------------------------------+
| Config File | Steps | Trigger Rules | Requisite CI/CD Variables | CI/CD Variables description |
+=============+==============================================+==================================================+=============================+===========================================================+
| | mypy check | | | |
| +----------------------------------------------+ | | |
| | flake8 check | + **Pushes** to *master/develop* branches | | |
| +----------------------------------------------+ | | |
| test.yml | bandit check | + **Pull Requests** to *master/develop* branches | | |
| +----------------------------------------------+ | | |
| | test with python 3.8 (Ubuntu/Mac OS/Windows) | | | |
| +----------------------------------------------+ | | |
| | test with python 3.9 (Ubuntu/Mac OS/Windows) | | | |
| +----------------------------------------------+ | | |
| | test with python 3.10 (Ubuntu/Mac OS/Windows)| | | |
| +----------------------------------------------+ | | |
| | test with python 3.11 (Ubuntu/Mac OS/Windows)| | | |
| +----------------------------------------------+ | | |
| | test with python 3.12 (Ubuntu/Mac OS/Windows)| | | |
| +----------------------------------------------+ | | |
| | twine check the built package | | | |
+-------------+----------------------------------------------+--------------------------------------------------+-----------------------------+-----------------------------------------------------------+
| | | | | Token for uploading package to official PyPi. If you're |
| | | | POETRY_PYPI_TOKEN_PYPI | using a private artifactory, please use the variables |
| | | | | `PACKAGE_INDEX_REPOSITORY_URL`, `PACKAGE_INDEX_USERNAME`, |
| | | | | and `PACKAGE_INDEX_PASSWORD` instead. |
| | | +-----------------------------+-----------------------------------------------------------+
| | | | PACKAGE_INDEX_REPOSITORY_URL| URL of Private package index. |
| release.yml | deploy to PyPi | **Pushes** to tags matching *vXX.XX.XX* +-----------------------------+-----------------------------------------------------------+
| | | | PACKAGE_INDEX_USERNAME | Username of Private package index. |
| | | +-----------------------------+-----------------------------------------------------------+
| | | | PACKAGE_INDEX_PASSWORD | Password of Private package index. |
+-------------+----------------------------------------------+--------------------------------------------------+-----------------------------+-----------------------------------------------------------+
| sphinx.yml | deploy GitHub pages | **Pushes** to *master* branch | | |
+-------------+----------------------------------------------+--------------------------------------------------+-----------------------------+-----------------------------------------------------------+
**Note**:
+ Before publishing the GitHub pages of your project for the first time, please manually create the branch **gh-pages** via::
$ git checkout master
$ git checkout -b gh-pages
$ git push origin gh-pages
Setup Steps
:::::::::::
1. Go to **Settings**.
2. Click **Secrets** section.
3. Click **New repository secret** button.
4. Input the name and value of a CI/CD variable.
GitLab CI
~~~~~~~~~
The file ``.gitlab-ci.yml`` contains all the configurations for GitLab CI.
Content
:::::::
+---------+---------------------------------+-------------------------------------------+------------------------------+-----------------------------------------------------------+
| Stages | Steps | Trigger Rules | Requisite CI/CD Variables | CI/CD Variables description |
+=========+=================================+===========================================+==============================+===========================================================+
| | mypy check | | | |
| +---------------------------------+ | | |
| linting | flake8 check | + **Pushes** to *master/develop* branches | | |
| +---------------------------------+ | | |
| | bandit check | + Any **Merge Requests** | | |
+---------+---------------------------------+ | | |
| | test with python 3.8 | | | |
| +---------------------------------+ | | |
| test | test with python 3.9 | | | |
| +---------------------------------+ | | |
| | test with python 3.10 | | | |
| +---------------------------------+ | | |
| | test with python 3.11 | | | |
| +---------------------------------+ | | |
| | test with python 3.12 | | | |
+---------+---------------------------------+ | | |
| build | twine check the built package | | | |
+---------+---------------------------------+-------------------------------------------+------------------------------+-----------------------------------------------------------+
| | | | | Token for uploading package to official PyPi. If you're |
| | | | POETRY_PYPI_TOKEN_PYPI | using a private artifactory, please use the variables |
| | | | | `PACKAGE_INDEX_REPOSITORY_URL`, `PACKAGE_INDEX_USERNAME`, |
| | | | | and `PACKAGE_INDEX_PASSWORD` instead. |
| | | +------------------------------+-----------------------------------------------------------+
| deploy | deploy to PyPi | **Pushes** to tags matching *vXX.XX.XX* | PACKAGE_INDEX_REPOSITORY_URL | URL of Private package index. |
| | | +------------------------------+-----------------------------------------------------------+
| | | | PACKAGE_INDEX_USERNAME | Username of Private package index. |
| | | +------------------------------+-----------------------------------------------------------+
| | | | PACKAGE_INDEX_PASSWORD | Password of Private package index. |
+---------+---------------------------------+-------------------------------------------+------------------------------+-----------------------------------------------------------+
Setup Steps
:::::::::::
1. Go to **Settings**.
2. Click **CI/CD** section.
3. Go to **Variables** section.
4. Click **Add variable** button.
5. Input the name and value of a CI/CD variable.
By default, the flag **protected** is checked, which means the added variable can only be used for protected branches/tags.
If you want to keep your variable protected, please add wildcards **v*** as protected tags in **Settings** -> **Repository** -> **Protected tags**.
Or you can uncheck the box to use the variable for all branches and tags.
Bitbucket Pipelines
~~~~~~~~~~~~~~~~~~~
The file ``bitbucket-pipelines.yml`` contains all the configurations of Bitbucket Pipelines.
Content
:::::::
+---------------------------------+-------------------------------------------+------------------------------+-----------------------------------------------------------+
| Steps | Trigger Rules | Requisite CI/CD Variables | CI/CD Variables description |
+=================================+===========================================+==============================+===========================================================+
| mypy check | | | |
+---------------------------------+ | | |
| flake8 check | + **Pushes** to *master/develop* branches | | |
+---------------------------------+ | | |
| bandit check | + Any **Pull Requests** | | |
+---------------------------------+ | | |
| test with python 3.8 | | | |
+---------------------------------+ | | |
| test with python 3.9 | | | |
+---------------------------------+ | | |
| test with python 3.10 | | | |
+---------------------------------+ | | |
| test with python 3.11 | | | |
+---------------------------------+ | | |
| test with python 3.12 | | | |
+---------------------------------+ | | |
| twine check the built package | | | |
+---------------------------------+-------------------------------------------+------------------------------+-----------------------------------------------------------+
| | | | Token for uploading package to official PyPi. If you're |
| | | POETRY_PYPI_TOKEN_PYPI | using a private artifactory, please use the variables |
| | | | `PACKAGE_INDEX_REPOSITORY_URL`, `PACKAGE_INDEX_USERNAME`, |
| | | | and `PACKAGE_INDEX_PASSWORD` instead. |
| deploy to PyPi | **Pushes** to tags matching *vXX.XX.XX* +------------------------------+-----------------------------------------------------------+
| | | PACKAGE_INDEX_REPOSITORY_URL | URL of Private package index. |
| | +------------------------------+-----------------------------------------------------------+
| | | PACKAGE_INDEX_USERNAME | Username of Private package index. |
| | +------------------------------+-----------------------------------------------------------+
| | | PACKAGE_INDEX_PASSWORD | Password of Private package index. |
+---------------------------------+-------------------------------------------+------------------------------+-----------------------------------------------------------+
Setup Steps
:::::::::::
1. Go to **Repository settings**.
2. Click **Repository variables**.
3. Click **add** button.
4. Input the name and value of a CI/CD variable.
You need to enable pipelines before adding a new variable for the first time.
Makefile
++++++++
.. list-table::
:header-rows: 1
* - Command
- Description
* - clean
- Remove autogenerated folders and artifacts.
* - clean-pyc
- Remove python artifacts.
* - clean-build
- Remove build artifacts.
* - bandit
- Run `bandit`_ security analysis.
* - mypy
- Run `mypy`_ type checking.
* - flake8
- Run `flake8`_ linting.
* - install
- Install all the dependencies and the package itself.
* - test
- Run tests and generate coverage report.
* - build
- Build wheel package.
* - publish
- Publish the built wheel package.
Acknowledgements
----------------
Special thanks to the project `cookiecutter-pypackage <https://github.com/audreyfeldroy/cookiecutter-pypackage>`_ for the nice *CONTRIBUTING.rst* template.
Author
------
* `Zhiwei Zhang <https://github.com/zhiwei2017>`_ - *Author* / *Maintainer* - `zhiwei2017@gmail.com <mailto:zhiwei2017@gmail.com?subject=[GitHub]Pyckage%20Cookiecutter>`_
.. _bandit: https://bandit.readthedocs.io/en/latest/
.. _mypy: https://github.com/python/mypy
.. _flake8: https://gitlab.com/pycqa/flake8
.. _pytest: https://docs.pytest.org/en/stable/
.. _cookiecutter: https://github.com/cookiecutter/cookiecutter
.. _pyckage-cookiecutter: https://github.com/zhiwei2017/pyckage-cookiecutter
Raw data
{
"_id": null,
"home_page": "https://github.com/zhiwei2017/pyckage-cookiecutter",
"name": "Pyckage-Cookiecutter",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8.1,<4.0.0",
"maintainer_email": "",
"keywords": "cookiecutter template,python38,python39,python310,github-actions,gitlab-ci,bitbucket-pipelines",
"author": "Zhiwei Zhang",
"author_email": "zhiwei2017@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/1a/e5/bb8b12df551dc22db620177140855a2e66408cd67fa42f2d4c1218b032cb/pyckage_cookiecutter-1.0.2.tar.gz",
"platform": null,
"description": "Pyckage Cookiecutter\n====================\n\n.. actions building badge\n.. image:: https://github.com/zhiwei2017/pyckage-cookiecutter/workflows/Unit%20Test%20&%20Build%20Test/badge.svg\n :target: https://github.com/zhiwei2017/pyckage-cookiecutter/actions\n\n.. pypi version badge\n.. image:: https://img.shields.io/pypi/v/pyckage-cookiecutter.svg\n :target: https://pypi.python.org/pypi/pyckage-cookiecutter/\n\n.. license badge\n.. image:: https://img.shields.io/pypi/l/pyckage-cookiecutter.svg\n :target: https://pypi.python.org/pypi/pyckage-cookiecutter/\n\n.. python version badge from PyPI\n.. image:: https://img.shields.io/pypi/pyversions/pyckage-cookiecutter.svg\n :target: https://pypi.python.org/pypi/pyckage-cookiecutter/\n :alt: Python 3.8 | Python 3.9 | Python 3.10 | Python 3.11 | Python 3.12\n\n.. pypi format\n.. image:: https://img.shields.io/pypi/format/pyckage-cookiecutter.svg\n :target: https://badge.fury.io/py/pyckage-cookiecutter\n\nIntroduction\n------------\n\nThis projects consist of a cookiecutter_\ntemplate that generates a full structure for a creating a PyPi standard package.\n\nWhile using this project, you will be asked to provide some inputs such as the author,\nthe name of the project, etc. As result you will obtain the\ncomplete file and folder structure to quickly start to code your package.\n\nHow to Use\n----------\n\nTutorial\n++++++++\n\nLet's pretend you want to create a project called \"feddit\".\nBy using this template based on cookiecutter_,\nyou will be able to quickly setup a buildable PyPi package.\n\nFirst, get cookiecutter_. Trust me, it's awesome::\n\n $ pip install cookiecutter\n\nor with **poetry**::\n\n $ poetry self add cookiecutter\n\nNow run it against this repo::\n\n $ cookiecutter https://github.com/zhiwei2017/pyckage-cookiecutter\n \nor::\n\n $ poetry run cookiecutter https://github.com/zhiwei2017/pyckage-cookiecutter\n\nYou'll be prompted for some values. Provide them, then a project will be created for you.\n\n**Warning**: After this point, change '*My Awesome Project*', '*John Doe*', etc to your own information.\n\nAnswer the prompts with your own desired `Prompts <https://zhiwei2017.github.io/pyckage-cookiecutter/02_prompts.html>`_. For example::\n\n Cloning into 'pyckage-cookiecutter'...\n remote: Enumerating objects: 219, done.\n remote: Counting objects: 100% (219/219), done.\n remote: Compressing objects: 100% (123/123), done.\n remote: Total 219 (delta 83), reused 181 (delta 69), pack-reused 0\n Receiving objects: 100% (219/219), 41.09 KiB | 1.71 MiB/s, done.\n Resolving deltas: 100% (83/83), done.\n [1/8] Select your project name (My Awesome Project):\n [2/8] Project URL for hosting the source code. (https://repository-hosting.com/example_project): https://github.com/zhiwei2017/feddit\n [3/8] Author full name. (John Doe): John Doe\n [4/8] Author email address. (john.doe@email.com): john.doe@example.com\n [5/8] Short description. (Behold My Awesome Project!): A fake reddit API.\n [6/8] Semantic version to use for release. (0.1.0): 0.1.0\n [7/8] Which license do you want to use for your project?\n 1 - None\n 2 - MIT\n 3 - APACHE\n 4 - 2-Clause BSD\n 5 - 3-Clause BSD\n 6 - GPL\n Choose from [1/2/3/4/5/6] (1): 2\n [8/8] Which CI/CD pipelines do you plan to use?\n 1 - None\n 2 - GitHub\n 3 - GitLab\n 4 - Bitbucket\n Choose from [1/2/3/4] (1): 2\n **Please read the comments from README.rst in your project to get to know how to setup the CI/CD pipeline and use commands from Makefile.**\n\nEnter the project and take a look around::\n\n $ cd feddit/\n $ ls\n\nYour repo should have the following structure::\n\n feddit\n \u251c\u2500\u2500 .github - github actions configurations\n \u2502 \u2514\u2500\u2500 workflows\n \u2502 \u251c\u2500\u2500 test.yml - pipelines for linting checks and testing\n \u2502 \u251c\u2500\u2500 release.yml - pipelines for releases with tags\n \u2502 \u2514\u2500\u2500 sphinx.yml - pipelines for publishing github pages\n \u251c\u2500\u2500 docs - sphinx documentation\n \u2502 \u251c\u2500\u2500 Makefile - Makefile defines terminal commands for sphinx documentation\n \u2502 \u2514\u2500\u2500 source - documentation source folder\n \u2502 \u251c\u2500\u2500 01_about.rst\n \u2502 \u251c\u2500\u2500 02_source.rst\n \u2502 \u251c\u2500\u2500 03_authors.rst\n \u2502 \u251c\u2500\u2500 04_contributing.rst\n \u2502 \u251c\u2500\u2500 conf.py - sphinx configuration file\n \u2502 \u2514\u2500\u2500 index.rst\n \u251c\u2500\u2500 feddit\n \u2502 \u2514\u2500\u2500 __init__.py\n \u251c\u2500\u2500 tests - tests\n \u2502 \u251c\u2500\u2500 resources - resources used in tests\n \u2502 \u251c\u2500\u2500 conftest.py - fixtures in tests\n \u2502 \u2514\u2500\u2500 test_version.py - test version information.\n \u251c\u2500\u2500 .gitignore\n \u251c\u2500\u2500 CONTRIBUTING.rst - contributing guidelines\n \u251c\u2500\u2500 LICENSE\n \u251c\u2500\u2500 Makefile - predefined terminal commands\n \u251c\u2500\u2500 MANIFEST.in - commands, one per line, instructing setuptools to add or remove some set of files from the sdis\n \u251c\u2500\u2500 README.rst - package information\n \u251c\u2500\u2500 setup.cfg - configurations for flake8, since it doesn't support pyproject.toml.\n \u2514\u2500\u2500 pyproject.toml - package configuration file\n\nIf you want to use CI/CD pipeline for uploading your package to PyPi, please check the section **CI/CD configuration**.\n\n**Note**:\n\n+ This repo is built as a wheel package and uploaded to `PyPi <https://pypi.python.org/pypi/pyckage-cookiecutter/>`_. You can install it through **pip**::\n\n $ pip install pyckage-cookiecutter\n\n or through **poetry**::\n\n $ poetry self add pyckage-cookiecutter\n\n And start generating a new project by call::\n\n $ pyckage_cookiecutter\n \n or::\n\n $ poetry run pyckage_cookiecutter\n\n The rest is the same as the `Tutorial <#tutorial>`_ introduced.\n\nCI/CD Pipelines\n+++++++++++++++\n\nThe CI/CD pipelines are predefined in the generated project. Please check following sections for\nwhich steps are included and how to configure them in different platforms.\n\nGitHub Actions\n~~~~~~~~~~~~~~\n\nYou can find all the configuration files of GitHub Actions in ``.github/workflows`` folder.\n\nContent\n:::::::\n\n+-------------+----------------------------------------------+--------------------------------------------------+-----------------------------+-----------------------------------------------------------+\n| Config File | Steps | Trigger Rules | Requisite CI/CD Variables | CI/CD Variables description |\n+=============+==============================================+==================================================+=============================+===========================================================+\n| | mypy check | | | |\n| +----------------------------------------------+ | | |\n| | flake8 check | + **Pushes** to *master/develop* branches | | |\n| +----------------------------------------------+ | | |\n| test.yml | bandit check | + **Pull Requests** to *master/develop* branches | | |\n| +----------------------------------------------+ | | |\n| | test with python 3.8 (Ubuntu/Mac OS/Windows) | | | |\n| +----------------------------------------------+ | | |\n| | test with python 3.9 (Ubuntu/Mac OS/Windows) | | | |\n| +----------------------------------------------+ | | |\n| | test with python 3.10 (Ubuntu/Mac OS/Windows)| | | |\n| +----------------------------------------------+ | | |\n| | test with python 3.11 (Ubuntu/Mac OS/Windows)| | | |\n| +----------------------------------------------+ | | |\n| | test with python 3.12 (Ubuntu/Mac OS/Windows)| | | |\n| +----------------------------------------------+ | | |\n| | twine check the built package | | | |\n+-------------+----------------------------------------------+--------------------------------------------------+-----------------------------+-----------------------------------------------------------+\n| | | | | Token for uploading package to official PyPi. If you're |\n| | | | POETRY_PYPI_TOKEN_PYPI | using a private artifactory, please use the variables |\n| | | | | `PACKAGE_INDEX_REPOSITORY_URL`, `PACKAGE_INDEX_USERNAME`, |\n| | | | | and `PACKAGE_INDEX_PASSWORD` instead. |\n| | | +-----------------------------+-----------------------------------------------------------+\n| | | | PACKAGE_INDEX_REPOSITORY_URL| URL of Private package index. |\n| release.yml | deploy to PyPi | **Pushes** to tags matching *vXX.XX.XX* +-----------------------------+-----------------------------------------------------------+\n| | | | PACKAGE_INDEX_USERNAME | Username of Private package index. |\n| | | +-----------------------------+-----------------------------------------------------------+\n| | | | PACKAGE_INDEX_PASSWORD | Password of Private package index. |\n+-------------+----------------------------------------------+--------------------------------------------------+-----------------------------+-----------------------------------------------------------+\n| sphinx.yml | deploy GitHub pages | **Pushes** to *master* branch | | |\n+-------------+----------------------------------------------+--------------------------------------------------+-----------------------------+-----------------------------------------------------------+\n\n**Note**:\n\n+ Before publishing the GitHub pages of your project for the first time, please manually create the branch **gh-pages** via::\n\n $ git checkout master\n $ git checkout -b gh-pages\n $ git push origin gh-pages\n\nSetup Steps\n:::::::::::\n\n1. Go to **Settings**.\n2. Click **Secrets** section.\n3. Click **New repository secret** button.\n4. Input the name and value of a CI/CD variable.\n\nGitLab CI\n~~~~~~~~~\n\nThe file ``.gitlab-ci.yml`` contains all the configurations for GitLab CI.\n\nContent\n:::::::\n\n+---------+---------------------------------+-------------------------------------------+------------------------------+-----------------------------------------------------------+\n| Stages | Steps | Trigger Rules | Requisite CI/CD Variables | CI/CD Variables description |\n+=========+=================================+===========================================+==============================+===========================================================+\n| | mypy check | | | |\n| +---------------------------------+ | | |\n| linting | flake8 check | + **Pushes** to *master/develop* branches | | |\n| +---------------------------------+ | | |\n| | bandit check | + Any **Merge Requests** | | |\n+---------+---------------------------------+ | | |\n| | test with python 3.8 | | | |\n| +---------------------------------+ | | |\n| test | test with python 3.9 | | | |\n| +---------------------------------+ | | |\n| | test with python 3.10 | | | |\n| +---------------------------------+ | | |\n| | test with python 3.11 | | | |\n| +---------------------------------+ | | |\n| | test with python 3.12 | | | |\n+---------+---------------------------------+ | | |\n| build | twine check the built package | | | |\n+---------+---------------------------------+-------------------------------------------+------------------------------+-----------------------------------------------------------+\n| | | | | Token for uploading package to official PyPi. If you're |\n| | | | POETRY_PYPI_TOKEN_PYPI | using a private artifactory, please use the variables |\n| | | | | `PACKAGE_INDEX_REPOSITORY_URL`, `PACKAGE_INDEX_USERNAME`, |\n| | | | | and `PACKAGE_INDEX_PASSWORD` instead. |\n| | | +------------------------------+-----------------------------------------------------------+\n| deploy | deploy to PyPi | **Pushes** to tags matching *vXX.XX.XX* | PACKAGE_INDEX_REPOSITORY_URL | URL of Private package index. |\n| | | +------------------------------+-----------------------------------------------------------+\n| | | | PACKAGE_INDEX_USERNAME | Username of Private package index. |\n| | | +------------------------------+-----------------------------------------------------------+\n| | | | PACKAGE_INDEX_PASSWORD | Password of Private package index. |\n+---------+---------------------------------+-------------------------------------------+------------------------------+-----------------------------------------------------------+\n\nSetup Steps\n:::::::::::\n\n1. Go to **Settings**.\n2. Click **CI/CD** section.\n3. Go to **Variables** section.\n4. Click **Add variable** button.\n5. Input the name and value of a CI/CD variable.\n\n By default, the flag **protected** is checked, which means the added variable can only be used for protected branches/tags.\n If you want to keep your variable protected, please add wildcards **v*** as protected tags in **Settings** -> **Repository** -> **Protected tags**.\n\n Or you can uncheck the box to use the variable for all branches and tags.\n\nBitbucket Pipelines\n~~~~~~~~~~~~~~~~~~~\n\nThe file ``bitbucket-pipelines.yml`` contains all the configurations of Bitbucket Pipelines.\n\nContent\n:::::::\n\n+---------------------------------+-------------------------------------------+------------------------------+-----------------------------------------------------------+\n| Steps | Trigger Rules | Requisite CI/CD Variables | CI/CD Variables description |\n+=================================+===========================================+==============================+===========================================================+\n| mypy check | | | |\n+---------------------------------+ | | |\n| flake8 check | + **Pushes** to *master/develop* branches | | |\n+---------------------------------+ | | |\n| bandit check | + Any **Pull Requests** | | |\n+---------------------------------+ | | |\n| test with python 3.8 | | | |\n+---------------------------------+ | | |\n| test with python 3.9 | | | |\n+---------------------------------+ | | |\n| test with python 3.10 | | | |\n+---------------------------------+ | | |\n| test with python 3.11 | | | |\n+---------------------------------+ | | |\n| test with python 3.12 | | | |\n+---------------------------------+ | | |\n| twine check the built package | | | |\n+---------------------------------+-------------------------------------------+------------------------------+-----------------------------------------------------------+\n| | | | Token for uploading package to official PyPi. If you're |\n| | | POETRY_PYPI_TOKEN_PYPI | using a private artifactory, please use the variables |\n| | | | `PACKAGE_INDEX_REPOSITORY_URL`, `PACKAGE_INDEX_USERNAME`, |\n| | | | and `PACKAGE_INDEX_PASSWORD` instead. |\n| deploy to PyPi | **Pushes** to tags matching *vXX.XX.XX* +------------------------------+-----------------------------------------------------------+\n| | | PACKAGE_INDEX_REPOSITORY_URL | URL of Private package index. |\n| | +------------------------------+-----------------------------------------------------------+\n| | | PACKAGE_INDEX_USERNAME | Username of Private package index. |\n| | +------------------------------+-----------------------------------------------------------+\n| | | PACKAGE_INDEX_PASSWORD | Password of Private package index. |\n+---------------------------------+-------------------------------------------+------------------------------+-----------------------------------------------------------+\n\nSetup Steps\n:::::::::::\n\n1. Go to **Repository settings**.\n2. Click **Repository variables**.\n3. Click **add** button.\n4. Input the name and value of a CI/CD variable.\n\n You need to enable pipelines before adding a new variable for the first time.\n\nMakefile\n++++++++\n\n.. list-table::\n :header-rows: 1\n\n * - Command\n - Description\n * - clean\n - Remove autogenerated folders and artifacts.\n * - clean-pyc\n - Remove python artifacts.\n * - clean-build\n - Remove build artifacts.\n * - bandit\n - Run `bandit`_ security analysis.\n * - mypy\n - Run `mypy`_ type checking.\n * - flake8\n - Run `flake8`_ linting.\n * - install\n - Install all the dependencies and the package itself.\n * - test\n - Run tests and generate coverage report.\n * - build\n - Build wheel package.\n * - publish\n - Publish the built wheel package.\n\nAcknowledgements\n----------------\n\nSpecial thanks to the project `cookiecutter-pypackage <https://github.com/audreyfeldroy/cookiecutter-pypackage>`_ for the nice *CONTRIBUTING.rst* template.\n\nAuthor\n------\n\n* `Zhiwei Zhang <https://github.com/zhiwei2017>`_ - *Author* / *Maintainer* - `zhiwei2017@gmail.com <mailto:zhiwei2017@gmail.com?subject=[GitHub]Pyckage%20Cookiecutter>`_\n\n\n.. _bandit: https://bandit.readthedocs.io/en/latest/\n.. _mypy: https://github.com/python/mypy\n.. _flake8: https://gitlab.com/pycqa/flake8\n.. _pytest: https://docs.pytest.org/en/stable/\n.. _cookiecutter: https://github.com/cookiecutter/cookiecutter\n.. _pyckage-cookiecutter: https://github.com/zhiwei2017/pyckage-cookiecutter",
"bugtrack_url": null,
"license": "MIT",
"summary": "This projects consist of a cookiecutter template that generates a full structure for a creating a PyPi standard package.",
"version": "1.0.2",
"project_urls": {
"Documentation": "https://zhiwei2017.github.io/pyckage-cookiecutter/",
"Homepage": "https://github.com/zhiwei2017/pyckage-cookiecutter",
"Repository": "https://github.com/zhiwei2017/pyckage-cookiecutter"
},
"split_keywords": [
"cookiecutter template",
"python38",
"python39",
"python310",
"github-actions",
"gitlab-ci",
"bitbucket-pipelines"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "9288de1af8f7668ebd60849ca9a1b327b31b3ef65f839987d25de14069dab8e6",
"md5": "1b294ab8be806486dd45eed3e72933e9",
"sha256": "04d73cb639265e0612615880984eb7dd58a6c7cef81f4a0270073ebd9edf1e14"
},
"downloads": -1,
"filename": "pyckage_cookiecutter-1.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "1b294ab8be806486dd45eed3e72933e9",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8.1,<4.0.0",
"size": 31225,
"upload_time": "2023-11-08T15:15:35",
"upload_time_iso_8601": "2023-11-08T15:15:35.101319Z",
"url": "https://files.pythonhosted.org/packages/92/88/de1af8f7668ebd60849ca9a1b327b31b3ef65f839987d25de14069dab8e6/pyckage_cookiecutter-1.0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "1ae5bb8b12df551dc22db620177140855a2e66408cd67fa42f2d4c1218b032cb",
"md5": "095d28dbe9b70a6c9a61a0b8ea5ac7aa",
"sha256": "772a99c113d788bce6e4d8d485eab16b4b21abf19babaa7f0076be07fcb3756d"
},
"downloads": -1,
"filename": "pyckage_cookiecutter-1.0.2.tar.gz",
"has_sig": false,
"md5_digest": "095d28dbe9b70a6c9a61a0b8ea5ac7aa",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8.1,<4.0.0",
"size": 24096,
"upload_time": "2023-11-08T15:15:36",
"upload_time_iso_8601": "2023-11-08T15:15:36.457827Z",
"url": "https://files.pythonhosted.org/packages/1a/e5/bb8b12df551dc22db620177140855a2e66408cd67fa42f2d4c1218b032cb/pyckage_cookiecutter-1.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-11-08 15:15:36",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "zhiwei2017",
"github_project": "pyckage-cookiecutter",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "pyckage-cookiecutter"
}