Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

Template repository for python package.

After duplicating this repository, you may rename the default package name, which is mypkg128, with your package name wherever it is declared. So rename it in:

  • pyproject.toml
  • tests.yaml
  • launch.json

Development setup

Prerequisites

This following packages must be installed

  • python
  • poetry
  • git

Configuration

  • poetry configuration, add environment variable POETRY_VIRTUALENVS_IN_PROJECT=true
  • vscode configuration, add environment variable PYTHON_VENV_LOC
    • on windows: PYTHON_VENV_LOC=.venv\\bin\\python.exe
    • on linux: PYTHON_VENV_LOC=.venv/bin/python
  • git configuration
git config --global user.name 'your name'
git config --global user.email 'your email'

Initialization

  • First setup poetry install
  • Then poetry shell

Build and publish with poetry

Build

Manuel steps to generate and publish the package to TestPyPI with poetry, documentation from packaging.python

Build the package, generate distribution archives

poetry build

Publish to Test PyPI

Add Test PyPI as an alternate package repository

poetry config repositories.testpypi https://test.pypi.org/legacy/

Upload/publish package/distribution archive to TestPyPI (a separate instance of the Python Package Index)

poetry publish -r testpypi

Installation with pip

pip install --index-url https://test.pypi.org/simple/ mypkg128

or

pip3 install --index-url https://test.pypi.org/simple/ mypkg128

Code of Conduct

History (changelog)

About

Basic python package repository template

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages