Inheritance Test
Explore inheritance of base/sub in same package on PyPi. Posted to StackOverflow.
Install (VSCode)
Source Control view, clone: https://github.com/valhuber/inheritance.git.
cd inheritance
virtualenv venv
# windows: .\venv\Scripts\activate
source venv/bin/activate
pip install -r requirements.txt
Run Locally
VSCode: F5 for run.py
. Should print:
super
Sub here
Deploy to Pypi
Since fab-quickstart is normally run via the command line, we must deploy to the PyPi site.
Using this reference...
Acquire the setup software (initial, 1-time setup):
cd inheritance
deactivate
python setup.py install
python3 -m pip install --user --upgrade twine
python3 -m pip install --user --upgrade setuptools wheel
Creating the dist
, first time
Get a Saved API Key
python3 setup.py sdist bdist_wheel # verify this produces the dist folder
python3 -m twine upload --repository testpypi dist/* # upload to test Pypi
User is __token__
, pwd is Saved API Key (from above).
This should upload to the Pypi site
To re-upload:
- Delete the
dist
folder (andbuild
, and.egg
) - Alter the version number in
__init__
python3 setup.py sdist bdist_wheel
python3 -m twine upload --skip-existing --repository testpypi dist/*
To install (beware - may require 15 mins until new version is active.
# windows: .\venv\Scripts\activate
source venv/bin/activate
pip uninstall inheritance-pkg # ensure we are running the latest
pip install -i https://test.pypi.org/simple/ inheritance-pkg
inheritance-run
Currently failing:
(venv) val@valMbp inheritance % inheritance-run
Traceback (most recent call last):
File "/Users/val/python/vscode/inheritance/venv/bin/inheritance-run", line 5, in <module>
from src.inheritance_pkg.run_local import start
ModuleNotFoundError: No module named 'src'
(venv) val@valMbp inheritance % ```
Manually restructured pip install fails same way: