diff --git a/setup.cfg b/setup.cfg index 9180e1b..d79cffb 100644 --- a/setup.cfg +++ b/setup.cfg @@ -30,12 +30,9 @@ keywords = [options] use_scm_version = True python_requires = >=3.8 -; package_dir = -; = src -; packages = find: - -; [options.packages.find] -; where = src +package_dir = + = src +packages = find: [options.extras_require] test = @@ -43,5 +40,8 @@ test = pytest-cov>=3.0.0 pytest>=7.0.0 +[options.packages.find] +where = src + [options.package_data] vagrant = py.typed diff --git a/vagrant/__init__.py b/src/vagrant/__init__.py similarity index 100% rename from vagrant/__init__.py rename to src/vagrant/__init__.py diff --git a/vagrant/compat.py b/src/vagrant/compat.py similarity index 100% rename from vagrant/compat.py rename to src/vagrant/compat.py diff --git a/vagrant/py.typed b/src/vagrant/py.typed similarity index 100% rename from vagrant/py.typed rename to src/vagrant/py.typed diff --git a/vagrant/test.py b/src/vagrant/test.py similarity index 100% rename from vagrant/test.py rename to src/vagrant/test.py diff --git a/tox.ini b/tox.ini index a364fe9..130c33e 100644 --- a/tox.ini +++ b/tox.ini @@ -55,6 +55,8 @@ deps = skip_install = true # Ref: https://twitter.com/di_codes/status/1044358639081975813 commands = + # Safety measure to remove library if somehow appears as installed + sh -c "pip uninstall -y python-vagrant 2>/dev/null" # build wheel and sdist using PEP-517 {envpython} -c 'import os.path, shutil, sys; \ dist_dir = os.path.join("{toxinidir}", "dist"); \ @@ -68,3 +70,7 @@ commands = twine check --strict {toxinidir}/dist/* # Install the wheel sh -c "python3 -m pip install {toxinidir}/dist/*.whl" + # Basic checks + python -c "import sys, pkgutil; sys.exit(0 if pkgutil.find_loader(sys.argv[1]) else 1)" vagrant + # Uninstall the wheel + pip uninstall -y python-vagrant