Observed since 21 Oct, 09:57 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
An example of a package developed with pyenv, built with build using setuptools, uploaded to PyPI using twine, and distributed via pip.
This package was created by generally following the Packaging Python Projects with the addition of some pipenv setup to manage virtual environments.
examplepackagefb1258 is replaced with your package's name. This name must be uniquely yours when uploaded to PyPI. Better to avoid hyphens or underline characters (- or _) in the package name, as these can create problems when importing. The parent directory name (the repository name) - python-package-example in this case - is not relevant to the package name.python-package-example/
|____README.md
|____LICENSE
|____pyproject.toml
|____tests
|____src
|____examplepackagefb1258
|______init__.py
|______main__.py
|____wisdom.py
__init__.py an empty file.LICENSE.pyproject.toml suitable for a setuptools-based build and add metadata fields to this file - see the example in this repository.src/examplepackagefb1258/wisdom.py or whatever filename(s) you choose for the module(s) that live within your package.__main__.py file to the package directory, if you want to be able to run the package as a script from the command line, e.g. python -m examplepackagefb1258.python -m build from the same directory where the pyproject.toml file is located..tar archive has the files you expect your package to have (including any important non-code files) by running the command: tar --list -f dist/examplepackagefb1258-0.0.7.tar.gz, where examplepackagefb1258-0.0.7 is replaced with your own package name and version.twine upload -r testpypi dist/*README.md file looks nice on the web site.Every time you change the code in your package, you will need to rebuild and reupload it to PyPI. You will need to build from a clean slate and update the version number to achieve this:
dist directorysrc/*.egg-info directorypyproject.toml and anywhere else it is mentioned (do a find/replace)python -m buildtwine upload -r testpypi dist/*Repeat as many times as necessary until the package works as expected. Once complete, upload to the real PyPI instead of the TestPyPI repository.
If updating version numbers is tedious, you may consider using bumpver - a tool that can automate some parts of updating version numbers.
Try installing and using your package in a separate Python project:
pipenv-managed virtual environment and install the latest version of your package installed: pipenv install -i https://test.pypi.org/simple/ examplepackagefb1258==0.0.7. (Note that if you've previously created a pipenv virtual environment in the same directory, you may have to delete the old one first. Find out where it is located with the pipenv --venv command.)pipenv shell.from examplepackagefb1258 import wisdom and then print(wisdom.get()) (replace wisdom and get() with any module name and function that exists in your package) .python3 my_program_filename.py.exit.Try running the package directly:
pipenv virtual environment as before.python3 -m examplepackagefb1258. This should run the code in the __main__.py file.Simple example unit tests are included within the tests directory. To run these tests...
python3 -m pytest.While working on the package code, and verifying it behaves as expected, it can be helpful to install the package in "editable" mode so that changes to the package are immediately updated in the virtual environment.
pipenv install -e . from the main project directory.This project has a continuous integration workflow that builds and runs unit tests automatically with every push of the code to GitHub.
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.0.1 | 16 Aug 2023 | 1 |
This describes our collected data; it is not a security assessment.
Observed since 21 Oct, 09:57 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:c8643240105ed578111ec966fae00d41581e1de72b06c9acba9c4ebb8a7f28a6