set package_dir=src and clean option
This commit is contained in:
@@ -1,6 +1,8 @@
|
|||||||
[build-system]
|
[build-system]
|
||||||
requires = [
|
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"
|
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"}
|
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" }
|
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]
|
# TODO cleanup
|
||||||
py-modules = ["extract_otp_secret_keys", "protobuf_generated_python"]
|
# [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"}
|
# version = {attr = "extract_otp_secret_keys.VERSION"}
|
||||||
|
|
||||||
[tool.setuptools-git-versioning]
|
[tool.setuptools-git-versioning]
|
||||||
enabled = true
|
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://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
|
# https://docs.pytest.org/en/7.1.x/explanation/goodpractices.html#which-import-mode
|
||||||
[tool.pytest.ini_options]
|
# [tool.pytest.ini_options]
|
||||||
addopts = [ "--import-mode=importlib", ]
|
# addopts = [ "--import-mode=importlib", ]
|
||||||
|
|||||||
16
setup.cfg
16
setup.cfg
@@ -4,17 +4,9 @@ name = extract_otp_secret_keys
|
|||||||
[options]
|
[options]
|
||||||
python_requires = >=3.7, <4
|
python_requires = >=3.7, <4
|
||||||
py_modules = extract_otp_secret_keys, protobuf_generated_python.google_auth_pb2
|
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 =
|
package_dir =
|
||||||
= src
|
=src
|
||||||
|
# packages=find:
|
||||||
|
|
||||||
[options.packages.find]
|
# [options.packages.find]
|
||||||
where = src
|
# where=src
|
||||||
|
|||||||
@@ -80,6 +80,7 @@ echo
|
|||||||
|
|
||||||
interactive=true
|
interactive=true
|
||||||
ignore_version_check=true
|
ignore_version_check=true
|
||||||
|
clean=false
|
||||||
|
|
||||||
while test $# -gt 0; do
|
while test $# -gt 0; do
|
||||||
case $1 in
|
case $1 in
|
||||||
@@ -91,6 +92,7 @@ while test $# -gt 0; do
|
|||||||
echo "Options:"
|
echo "Options:"
|
||||||
echo "-a Automatic mode"
|
echo "-a Automatic mode"
|
||||||
echo "-C Ignore version check"
|
echo "-C Ignore version check"
|
||||||
|
echo "-c Clean"
|
||||||
echo "-h, --help Help"
|
echo "-h, --help Help"
|
||||||
quit
|
quit
|
||||||
;;
|
;;
|
||||||
@@ -102,6 +104,10 @@ while test $# -gt 0; do
|
|||||||
ignore_version_check=false
|
ignore_version_check=false
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
-c)
|
||||||
|
clean=true
|
||||||
|
shift
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
@@ -122,6 +128,12 @@ OLDVERSION=$(cat $BIN/$DEST/.VERSION.txt || echo "")
|
|||||||
echo -e "\nProtoc remote version $VERSION\n"
|
echo -e "\nProtoc remote version $VERSION\n"
|
||||||
echo -e "Protoc local version: $OLDVERSION\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
|
if [ "$OLDVERSION" != "$VERSION" ] || ! $ignore_version_check; then
|
||||||
echo "Upgrade protoc from $OLDVERSION to $VERSION"
|
echo "Upgrade protoc from $OLDVERSION to $VERSION"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user