set package_dir=src and clean option

cv2_1
scito 1 year ago
parent 60d7362eee
commit ee404576d5

@ -1,6 +1,8 @@
[build-system]
requires = [
"setuptools>=64.0.0", "wheel>=0.37.0", "pip", "setuptools-git-versioning",
"setuptools>=64.0.0", "wheel>=0.37.0", "pip",
# https://setuptools-git-versioning.readthedocs.io/en/latest/differences.html
"setuptools-git-versioning",
]
build-backend = "setuptools.build_meta"
@ -46,19 +48,17 @@ requires-python = ">=3.7, <4"
scripts = {extract_otp_secret_keys = "extract_otp_secret_keys:sys_main"}
urls = {Project-URL = "https://github.com/scito/extract_otp_secret_keys", Bug-Reports = "https://github.com/scito/extract_otp_secret_keys/issues", Source = "https://github.com/scito/extract_otp_secret_keys" }
[tool.setuptools]
py-modules = ["extract_otp_secret_keys", "protobuf_generated_python"]
# TODO cleanup
# [tool.setuptools]
# py-modules = ["extract_otp_secret_keys", "protobuf_generated_python.protobuf_generated_python"]
[tool.setuptools.dynamic]
# [tool.setuptools.dynamic]
# version = {attr = "extract_otp_secret_keys.VERSION"}
[tool.setuptools-git-versioning]
enabled = true
[tool.setuptools.package-data]
"extract_otp_secret_keys" = ["*.txt", "*.json", "*.csv", "*.png", "*.md"]
# https://blog.ionelmc.ro/2014/05/25/python-packaging/#the-structure%3E
# https://docs.pytest.org/en/7.1.x/explanation/goodpractices.html#which-import-mode
[tool.pytest.ini_options]
addopts = [ "--import-mode=importlib", ]
# [tool.pytest.ini_options]
# addopts = [ "--import-mode=importlib", ]

@ -4,17 +4,9 @@ name = extract_otp_secret_keys
[options]
python_requires = >=3.7, <4
py_modules = extract_otp_secret_keys, protobuf_generated_python.google_auth_pb2
# install_requires =
# protobuf
# qrcode
# Pillow
# qreader
# pyzbar
# opencv-python
# typing_extensions;python_version<='3.7'
packages = find:
package_dir =
= src
=src
# packages=find:
[options.packages.find]
where = src
# [options.packages.find]
# where=src

@ -80,6 +80,7 @@ echo
interactive=true
ignore_version_check=true
clean=false
while test $# -gt 0; do
case $1 in
@ -91,6 +92,7 @@ while test $# -gt 0; do
echo "Options:"
echo "-a Automatic mode"
echo "-C Ignore version check"
echo "-c Clean"
echo "-h, --help Help"
quit
;;
@ -102,6 +104,10 @@ while test $# -gt 0; do
ignore_version_check=false
shift
;;
-c)
clean=true
shift
;;
esac
done
@ -122,6 +128,12 @@ OLDVERSION=$(cat $BIN/$DEST/.VERSION.txt || echo "")
echo -e "\nProtoc remote version $VERSION\n"
echo -e "Protoc local version: $OLDVERSION\n"
if $clean; then
cmd="rm -r dist/ build/ *.whl pytest.xml pytest-coverage.txt .coverage tests/reports || true; find . -name '*.pyc' -type f -delete; find . -name '__pycache__' -type d -exec rm -r {} \; || true; find . -name '*.egg-info' -type d -exec rm -r {} \; || true; find . -name '*_cache' -type d -exec rm -r {} \; || true"
if $interactive ; then askContinueYn "$cmd"; else echo -e "${cyan}$cmd${reset}";fi
eval "$cmd"
fi
if [ "$OLDVERSION" != "$VERSION" ] || ! $ignore_version_check; then
echo "Upgrade protoc from $OLDVERSION to $VERSION"

Loading…
Cancel
Save