diff --git a/.gitignore b/.gitignore index 4af2633239806b9a9161b52b9b32a14757564344..f886c6fad8b597bf0ab92157118d00bd31076922 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,9 @@ dist/* coverage.xml htmlcov/* +# Setuptools SCM +my_awesome_app/_version.py + # IDE configuration .vscode .idea diff --git a/MANIFEST.in b/MANIFEST.in index b13ed9c7090e38c21c3dfea23425f74b879f3da2..c4a3399ac9b36be786467e020c84f95e09db0606 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,6 +1,5 @@ include LICENSE include README.md -include VERSION recursive-include docs * recursive-exclude tests * diff --git a/README.md b/README.md index 979ee10941a6ed6da6e3617a93241d1d32c8cc6e..d52dc03b8a4e4febc26c9606d15626f28736bb83 100644 --- a/README.md +++ b/README.md @@ -9,12 +9,12 @@ If you find some missing functionality with regards to CI/CD, testing, linting o ## Installation ``` -pip install map +pip install . ``` ## Usage ``` -from map import cool_module +from my_awesome_app import cool_module cool_module.greeter() # prints "Hello World" ``` diff --git a/VERSION b/VERSION deleted file mode 100644 index ceab6e11ece0bcec917c12e11d350946f085d549..0000000000000000000000000000000000000000 --- a/VERSION +++ /dev/null @@ -1 +0,0 @@ -0.1 \ No newline at end of file diff --git a/map/__init__.py b/my_awesome_app/__init__.py similarity index 100% rename from map/__init__.py rename to my_awesome_app/__init__.py diff --git a/map/cool_module.py b/my_awesome_app/cool_module.py similarity index 100% rename from map/cool_module.py rename to my_awesome_app/cool_module.py diff --git a/pyproject.toml b/pyproject.toml index 3588ce52b18906626e85093548e7e323c81f0cf3..0dac729a29ca7703f10416c818c896a94f06b7e8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,13 @@ [build-system] -requires = ['setuptools>=42', 'wheel'] -build-backend = 'setuptools.build_meta' +requires = [ + "setuptools>=45", + "setuptools_scm[toml]>=6.2", + "wheel" +] +build-backend = "setuptools.build_meta" + +[tool.setuptools_scm] +write_to = "my_awesome_app/_version.py" + +[tool.pylint] +ignore = "_version.py" diff --git a/setup.cfg b/setup.cfg index 49a4e69444be5c0daecefe6c1926af13673fe60f..97e129f9cc5be5f6a9b0dc946c25b493e5552d25 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,5 @@ [metadata] name = my-awesome-app -version = file: VERSION description = An example package for CI/CD working group long_description = file: README.md long_description_content_type = text/markdown diff --git a/tests/test_cool_module.py b/tests/test_cool_module.py index da1002b8b66176f7efb5e24c3b4748d0eb49ed51..4ab4889a09bfa270c4b4a14679839277f67d6934 100644 --- a/tests/test_cool_module.py +++ b/tests/test_cool_module.py @@ -1,7 +1,7 @@ """Testing of the Cool Module""" from unittest import TestCase -from map.cool_module import greeter +from my_awesome_app.cool_module import greeter class TestCoolModule(TestCase): diff --git a/tox.ini b/tox.ini index c0530645e8f647ea7d94921271c1227dcd3522b0..d5388949afbca56f8f7bd3c979409c7cfd78d3b0 100644 --- a/tox.ini +++ b/tox.ini @@ -34,8 +34,8 @@ commands = black: {envpython} -m black --version black: {envpython} -m black --check --diff . pylint: {envpython} -m pylint --version - pylint: {envpython} -m pylint map tests - format: {envpython} -m autopep8 -v -aa --in-place --recursive map + pylint: {envpython} -m pylint my_awesome_app tests + format: {envpython} -m autopep8 -v -aa --in-place --recursive my_awesome_app format: {envpython} -m autopep8 -v -aa --in-place --recursive tests format: {envpython} -m black -v .