All Projects → iancleary → pypackage

iancleary / pypackage

Licence: MIT license
Cookiecutter python package using Poetry, mypy, black, isort, autoflake, pytest, mkdocs, and GitHub Actions

Programming Languages

Makefile
30231 projects
shell
77523 projects
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to pypackage

python-lint
GitHub Action for Lint your code
Stars: ✭ 57 (+375%)
Mutual labels:  black, mypy, isort
rubric
Linter Config Initializer for Python
Stars: ✭ 21 (+75%)
Mutual labels:  black, mypy, isort
prisma-client-py
Prisma Client Python is an auto-generated and fully type-safe database client designed for ease of use
Stars: ✭ 739 (+6058.33%)
Mutual labels:  python37, python38, pydantic
Pydantic
Data parsing and validation using Python type hints
Stars: ✭ 8,362 (+69583.33%)
Mutual labels:  python37, python38, pydantic
hypercorn-fastapi-docker
Docker image with Hypercorn for FastAPI apps in Python 3.7, 3.8, 3.9. Ready for HTTP2 and HTTPS
Stars: ✭ 18 (+50%)
Mutual labels:  python37, python38
aioredis-cluster
Redis Cluster support extension for aioredis
Stars: ✭ 21 (+75%)
Mutual labels:  python37, python38
mcpyrate
Advanced macro expander and language lab for Python.
Stars: ✭ 35 (+191.67%)
Mutual labels:  python37, python38
mutatest
Python mutation testing: test your tests! Safely run mutation trials without source code modifications and see what will get past your test suite.
Stars: ✭ 50 (+316.67%)
Mutual labels:  python37, python38
Aioredis Py
asyncio (PEP 3156) Redis support
Stars: ✭ 2,003 (+16591.67%)
Mutual labels:  python37, python38
Dephell
📦 🔥 Python project management. Manage packages: convert between formats, lock, install, resolve, isolate, test, build graph, show outdated, audit. Manage venvs, build package, bump version.
Stars: ✭ 1,730 (+14316.67%)
Mutual labels:  pipenv, flit
awesome-python-code-formatters
A curated list of awesome Python code formatters
Stars: ✭ 168 (+1300%)
Mutual labels:  black, isort
starlite
Light, Flexible and Extensible ASGI API framework
Stars: ✭ 1,525 (+12608.33%)
Mutual labels:  mypy, pydantic
docker-cgi-python
🐳Docker file for cgi using python2.7, 3.6, 3.7, 3.8, 3.9 and 3.10🐍
Stars: ✭ 13 (+8.33%)
Mutual labels:  python37, python38
reactant
Generate code for "models, views, and urls" based on Python type annotations. Supports Django REST, SQLAlchemy, Peewee.
Stars: ✭ 14 (+16.67%)
Mutual labels:  black, pydantic
tukaan
A modern, cross platform Python toolkit for creating desktop GUI applications. Contributors are welcome!
Stars: ✭ 97 (+708.33%)
Mutual labels:  python37, python38
flake8-annotations
Flake8 Type Annotation Checking
Stars: ✭ 117 (+875%)
Mutual labels:  python37, python38
docopt-ng
Humane command line arguments parser. Now with maintenance, typehints, and complete test coverage.
Stars: ✭ 94 (+683.33%)
Mutual labels:  mypy
CPP Template
C++ project template : CMake, Test, Travis CI, Appveyor, CodeCoverage, Doxygen
Stars: ✭ 32 (+166.67%)
Mutual labels:  travis-ci
django-quick-start
Deploy a Django app on Render
Stars: ✭ 17 (+41.67%)
Mutual labels:  cookiecutter
spring-discord-bot
Discord all-purpose bot, made using Spring Boot, JPA, Hibernate, REST, HikariCP. Written for fun, do not take this serious.
Stars: ✭ 26 (+116.67%)
Mutual labels:  travis-ci

ARCHIVED, pypackage

I no longer with to maintain this cookiecutter, please see br3ndonland/template-python's template. While not a cookiecutter at the time of this writing, it has the tooling I was going for :)

Rapid python package setup with modern venv, dependencies, testing, docs, and CI

Test Publish Dependabot Enabled

The Basic Idea

This is a template module collecting many utilities I have liked from other projects, to serve as a personal reference.

Getting started with this template

pip install --user cookiecutter

$ cookiecutter https://github.com/iancleary/pypackage
# For the sake of brevity, repos on GitHub can just use the 'gh' prefix
$ cookiecutter gh:iancleary/pypackage

Features

  • Poetry (virtual environment and publish to PyPi, all with one tool)
  • black (linting/formatter)
  • autoflake (removing unused packages)
  • isort (dependency organization)
  • mypy (static type checking)
  • pytest (including test coverage)
  • pre-commit (hooks on commit)
  • GitHub Actions for CI/CD
  • mkdocs for documentation (with material theme)

Only Python 3.6+ is supported as required by the black, pydantic packages


Publishing to Pypi

Poetry's documentation

Note that it is recommended to use API tokens when uploading packages to PyPI.

Once you have created a new token, you can tell Poetry to use it:

https://python-poetry.org/docs/repositories/#configuring-credentials

We do this using GitHub Actions' Workflows and Repository Secrets!

Repo Secrets

Go to your repo settings and add a PYPI_TOKEN environment variable:

Github Actions setup of Poetry token environment variable

Inspect the GitHub Actions Publish Workflows

Within the cookiecutter project!

name: Publish

on:
  release:
    types:
      - created

jobs:
  publish:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      ...
      ...
      ...
      - name: Publish
        env:
          PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
        run: |
          poetry config pypi-token.pypi $PYPI_TOKEN
          bash scripts/publish.sh

That's it!

When you make a release on GitHub, the publish workflow will run and deploy to PyPi! 🚀🎉😎

The publish.yml GitHub Workflow for this repo intentionally only builds the package. The limited purpose is to demonstrate the publish workflow trigger and allow you to inspect the file's similarity to the equivalent file within the cookiecutter.

Contributing Guide

Welcome! 😊👋

Please see the Contributing Guide.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].