Say Hello
Project description
Packaging Tutorial
This is a tutorial on setting up python packages for PyPi. Steps were learned from: Publishing (Perfect) Python Packages on PyPi
Notes
- From the folder level with setup.py : python setup.py sdist bdist_wheel
- Builds a wheel that is appropriate to upload to PyPi
- The name used in the setup.py file is added. This was a point of confusion for me. this name is what you pip install not necessarily the name of the pythjon code that will be imported
- From the folder level with setup.py : pip install –e .
- installs it locally. Tests packaging and makes it useful to your system.
- The ‘–e’ allows it to link to the code you are working on rather than building copies . The ‘ .’ means install in the current directory. Everytime you change the setup.py file you need to run this
- The name used in the setup.py file is added. This was a point of confusion for me
- Test it:
- from python environment in any folder from hellototi import say_hello
- ‘hellototi’ is the python module
- The name ‘PyPipackaging’ is from setup.py -> name=’hellototiname’. It is the name of the python script in the src folder. Within this script is the function say_hello
- Remove excessive files with gitignore.io
- Pip install twine
- Twine upload dist/* user name and pasword from PyPi.com
Folder structure
packaging_tutorial
|-LICENSE.txt **MIT**
|-README.md **edited in markdown**
|-setup.py **name=PyPipackaging, package=src, python module=hellototi**
|-src
|-hellototi.py **contains a function called say_hello()**
|-__init__.py ** empty**
Application
- this package can be installed using pip install PyPipackaging
- once installed the python code can be implemented by typing from hellototi import say_hello
- say_hello is the function within the hellototi python code that is installed with the PyPipacking PIP install
- I had to restart the kernal in Spyder to recognize the python module
Notes
- For local pip install
- to upgrade an installed package: python -m pip install --upgrade SomeProject
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
PyPipackaging-0.0.6.tar.gz
(3.3 kB
view hashes)
Built Distribution
Close
Hashes for PyPipackaging-0.0.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bdcc3184a468da0a736aacaeb32c7c3f7f2b7585437ae5290c207fd26a31698e |
|
MD5 | 7c6696377db4fae2eb07cf1a8823ea16 |
|
BLAKE2b-256 | 765578511070661a7922467b9eea95d16546abf5fc820fd5f3f6a87205194c89 |