-
Notifications
You must be signed in to change notification settings - Fork 6
Generate package
This project are using the PEP 517 approach, using setup.cfg and pyproject.toml files.
So, for create a .whl (Wheel) and tar.gz files, enter on this repository folder and run the command below:
python -m build --sdist --wheel .After that, will be generated a folder called dist with the files: surface_reconstruction-0.1.1.dev1-py3-none-any.whl and surface_reconstruction-0.1.1.dev1-tar.gz. These files may contains the suffix dirty, if your current branch contains uncommitted changes. Something like this below:
./surface_reconstruction_python
|
|-dist
|-surface_reconstruction-0.1.1.dev1+dirty.tar.gz
|-surface_reconstruction-0.1.1.dev1+dirty-py3-none-any.whlThe version of these files are generated from the last local git tag, and increment +1. A file
version.pyis generated with this as well
Install from the .whl generated file
pip install dist/surface_reconstruction-x.x.x.whlOptionally you can install from the .tar.gz source as well
pip install dist/surface_reconstruction-x.x.x.tar.gzFirst, publish to https://test.pypi.org and verify if everything is ok with this package:
# Install "twine" package if is not installed
pip install twine
# Publish the .tar.gz and .whl files
twine upload --repository-url https://test.pypi.org/legacy/ dist/*Now, you can test pip install from the command line:
pip install --index-url https://test.pypi.org/simple surface_reconstruction --userDo the same commands above, and just remove the --repository-url argument. By default, twine uploads to https://pypi.org. When you execute pip install, just remove --index-url argument as well:
pip install surface_reconstructionif everything is all right, your package is installed in your local python environment and you can import and use it 😃