Skip to content

rnowotniak/python-packaging-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Python packaging example

Contact: Robert Nowotniak <[email protected]>

This is a simple example package.

References:

Usage

Update version variable in setup.py

Rebuild the package (source and dist):

python setup.py sdist bdist_wheel

Then, run:

python -m twine upload -r testpypi dist/example*

Upload result:

$ python -m twine upload -r testpypi dist/example*
Uploading distributions to https://test.pypi.org/legacy/
Enter your username: __token__
Enter your password: *******************
Uploading example_pkg_rnowotniak-0.0.3-py3-none-any.whl
100%|███████████████████████████████████
Uploading example-pkg-rnowotniak-0.0.3.tar.gz
100%|███████████████████████████████████

View at:
https://test.pypi.org/project/example-pkg-rnowotniak/0.0.3/

Installing the package:

$ pip install --user --upgrade -i https://test.pypi.org/simple/ example-pkg-rnowotniak 
Looking in indexes: https://test.pypi.org/simple/
Collecting example-pkg-rnowotniak
  Downloading https://test-files.pythonhosted.org/packages/42/f2/f1f(...)3da48c7/example_pkg_rnowotniak-0.0.3-py3-none-any.whl (2.5 kB)
Installing collected packages: example-pkg-rnowotniak
Successfully installed example-pkg-rnowotniak-0.0.3

Import and use the package:

$ python
Python 3.9.0 (default, Oct  7 2020, 23:09:01) 
[GCC 10.2.0] on linux

>>> import example_pkg
test!
>>> 

About

Python packaging example package

Topics

Resources

License

Stars

Watchers

Forks

Languages