Skip to main content

No project description provided

Project description

test package build with poetry

Comparing to setuptools, poetry is all-in-one shop and with less manual configuration in python package development cycle. For example, pyproject.toml is created by poetry with format of PEP 518 package specs with poetry new command.

pyenv shell 3.9.11
python -m venv ./venv
source venv/bin/activate
python -m pip install --upgrade pip
pip install poetry

package initialization

Use poetry to initialzes a package under project root:

poetry new test_pkg_poetry_binlecode

Use poetry to add dependencies, they are added to pyproject.toml by poetry automatically.

# add pytest as dev dependency
poetry add pytest --dev
# show dependency tree
poetry show --tree
# generate lock file
poetry lock

# The install command reads the pyproject.toml file from the current project,
# resolves the dependencies, and installs them.
# If poetry.lock exists, the lock file is used instead of resolving dependencies.
poetry install

poetry export --output requirements.txt

testing with pytest

Run pytest at project root level, it will scan tests folder and test scripts.

poetry run pytest

source code formatting with black

poetry run black .

build distribution and publish

Check package and build distribution. Poetry builds both source and wheel distributions.

poetry check
poetry build

To publish to pypi, config api token first.

poetry config pypi-token.pypi <my-token>

Poetry can use token to publish:

poetry publish

Publishing test-pkg-poetry-binlecode (0.1.0) to PyPI
 - Uploading test-pkg-poetry-binlecode-0.1.0.tar.gz 100%
 - Uploading test_pkg_poetry_binlecode-0.1.0-py3-none-any.whl 100%

github cicd workflows

Black (PEP8) lint check is triggered on all push and pull requests.

Pull-request driven tests cover python 3.8, 3.9 on multiple platforms.

Release candidate is built with python 3.9 on ubuntu-latest platform.

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

test_pkg_poetry_binlecode-0.1.4.tar.gz (2.3 kB view details)

Uploaded Source

Built Distribution

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

test_pkg_poetry_binlecode-0.1.4-py3-none-any.whl (2.4 kB view details)

Uploaded Python 3

File details

Details for the file test_pkg_poetry_binlecode-0.1.4.tar.gz.

File metadata

  • Download URL: test_pkg_poetry_binlecode-0.1.4.tar.gz
  • Upload date:
  • Size: 2.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.9.11 Darwin/21.6.0

File hashes

Hashes for test_pkg_poetry_binlecode-0.1.4.tar.gz
Algorithm Hash digest
SHA256 ff7bdce39e41255a906ded38deaad61696fb7d27f154290a3bc817c610d9f8e7
MD5 4d8d98246007c2b254fc32dd903a92f4
BLAKE2b-256 69bd43e7c959e16201e041e84c8f3afe445449032b0b5739a990380da09d22eb

See more details on using hashes here.

File details

Details for the file test_pkg_poetry_binlecode-0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for test_pkg_poetry_binlecode-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 a0d075ccb88f617b52bf5dba70598bf1095fc6b29233130900726735eb38da98
MD5 f7d4e1d4c72150cc593e14636b5e5a1d
BLAKE2b-256 a56c4c3957b35769a0ae58817bee8fdc9cb020ee59a3f328c561e78ff277fb45

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