Skip to content

bbkane/example-python-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fairly recently, it's become possible to write Python packages without a setup.py! This is an example of how to do that.

From: https://setuptools.pypa.io/en/latest/userguide/quickstart.html

Create venv and run tests

cd example-python-cli  # this README's directory
./run.sh test  # setup venv and run tests

Activate the venv and run the CLI

source venv/bin/activate
 # run entrypoint script to confirm it all works
example-python-cli

This package can also be installed globally without polluting the global python package installation with pipx

pipx install -e .

Notes

Re-installing Python

This can be necessary when I screw up scripts/run.sh.

  1. Find location of a package: python3 -m pip show black
  2. rm the parent folder: rm -rf /usr/local/lib/python3.10/site-packages
  3. Reinstall Python: brew reinstall python3

TODO

About

A small example Python package to demo file structure/tools

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published