Skip to main content

Python Project Package Template

Project description

Python Project Template

Install dependencies

Install pipenv to manage dependencies

pip install --user pipenv

If you get a warning like

WARNING: The scripts pipenv and pipenv-resolver are installed in '/home/${REPLACE_UBUNTU_USERNAME_HERE}/.local/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.

Modify PATH system variable to use pipenv

nano ~/.zshrc

Add the next line at the end of the file

export PATH="$PATH:/home/${REPLACE_UBUNTU_USERNAME_HERE}/.local/bin"

Create .env file with environment variable

PIPENV_VENV_IN_PROJECT=1

Finally, install dependencies using pipenv

pipenv install --dev

Select virtual environment in VS Code

  1. Open Command Prompt: Ctrl + Shift + P

  2. Write Python: Select Interpreter

  3. Select your virtual environment

Should be something like ./.venv/bin/python

Test project with pytest

pytest

Install pre-commit hooks in your repository to use pytest

pre-commit install

Install commit linter hook to follow conventional commits guide like here

commit-linter install

Pylint

  1. Open Command Prompt: Ctrl + Shift + P

  2. Write Python: Select Linter

  3. Select pylint

Working with pipenv

  • To activate this project's virtual environment, run pipenv shell.
  • Alternatively, run a command inside the virtual environment with pipenv run.

Template setup

  1. Set GH_TOKEN secret using a personal access token to use semantic release
  2. Set PYPI_TOKEN secret using an auth token from PyPI to upload your project

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

web-utils-soft-0.4.1.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

web_utils_soft-0.4.1-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file web-utils-soft-0.4.1.tar.gz.

File metadata

  • Download URL: web-utils-soft-0.4.1.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.10

File hashes

Hashes for web-utils-soft-0.4.1.tar.gz
Algorithm Hash digest
SHA256 82454ae8bf9aea6a874a07172a60f2a6b2964a3af658cf04035db9974d382a63
MD5 744bc11f518a44aea4671e2ebe1fbb2d
BLAKE2b-256 e7b6b6d6702b2f970b1712050af1cb09d33a2677b4a3ceebdaad3af41b1d087f

See more details on using hashes here.

File details

Details for the file web_utils_soft-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: web_utils_soft-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.10

File hashes

Hashes for web_utils_soft-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 71ae25bc4b1591bc6166b284c3aaf27356bc05fb1f5d8ebba0a64b971d9837b2
MD5 e79f1d6793b62786f036fcf707c9e3c4
BLAKE2b-256 bacbacecdbfe87c2638fc73ffbc0942990c4f224338afac6d479f0da8ec5adac

See more details on using hashes here.

Supported by

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