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
|-pypipackaging.py **contains functions**
|-__init__.py ** empty**
Application
- this package can be installed using pip install PyPipackaging
- once installed the python code can be implemented by typing from pypipackaging import Funsum in Python environment
- In Python interpreter like Spider you can type import pypipackaging followed by pypipackaging.Funsum(10,10))
- I had to restart the kernal in Spyder to recognize the python module
Notes
- Install wheel pip install wheel
- python setup.py sdist bdist_wheel - this makes sdist build, and .egg-info files in directory
- pip install -e . - this installs it locally so it can be tested. use pip list to see local vs. global modules
- at this point you can use: import pypipackaging and pypipackaging.Funsum(10,10) from the Python environment. It is locally installed (see pip list from cmd)
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.8.tar.gz
(3.4 kB
view details)
Built Distribution
File details
Details for the file PyPipackaging-0.0.8.tar.gz
.
File metadata
- Download URL: PyPipackaging-0.0.8.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c7efbcb6dd6287939fd0cfe57c05ee59b36585f002a6a44a80db1d4625a788c |
|
MD5 | 359f59882b9bc4dc0af8c8b4c50ae53c |
|
BLAKE2b-256 | b4d6b3b057601af9dcaf57929077b6ccd6c708e2207ed30ae92e1a7c1b8d9cc8 |
File details
Details for the file PyPipackaging-0.0.8-py3-none-any.whl
.
File metadata
- Download URL: PyPipackaging-0.0.8-py3-none-any.whl
- Upload date:
- Size: 3.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d4c5b78a013de89c8439607e715be030378f541720813aef9ca5802377b3af9 |
|
MD5 | 8657dc582e2b61eadeacd35be4b5ac1d |
|
BLAKE2b-256 | 8cadc5d0b4056cad40f50a2d28deb9be732aaceb594d98b7271239d0a4b56c56 |