From a9262e3cd9473d2eb91dccaa189166e4d257f26b Mon Sep 17 00:00:00 2001 From: Thomas Burghout Date: Wed, 16 Mar 2022 10:42:20 +0100 Subject: [PATCH] Add poetry as project management tool (#25) Co-authored-by: Sander Meinderts --- .gitignore | 4 +++- README.md | 7 ++++++- poetry.lock | 8 ++++++++ pyproject.toml | 36 ++++++++++++++++++++++++++++++++++++ scripts.py | 10 ++++++++++ 5 files changed, 63 insertions(+), 2 deletions(-) create mode 100644 poetry.lock create mode 100644 pyproject.toml create mode 100644 scripts.py diff --git a/.gitignore b/.gitignore index a6ffe41..5811d86 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ venv __pycache__ -.ipynb_checkpoints \ No newline at end of file +.* +!.gitignore +dist/ diff --git a/README.md b/README.md index 107a57e..b28b142 100644 --- a/README.md +++ b/README.md @@ -42,5 +42,10 @@ hex_to_epc("36300001DB011169E5E5A70EC000000000000000000000000000") ``` ## Development + +This project uses [Poetry](https://python-poetry.org/) for project management. +Poetry must be installed and available in `$PATH`. +After cloning run `poetry install` to install (development) dependencies. + ### Testing -This module uses the Python unittest library. Run `python -m unittest discover` for running the tests. +This module uses the Python unittest library. Run `poetry run tests` for running the tests. diff --git a/poetry.lock b/poetry.lock new file mode 100644 index 0000000..f41588b --- /dev/null +++ b/poetry.lock @@ -0,0 +1,8 @@ +package = [] + +[metadata] +lock-version = "1.1" +python-versions = "^3.8" +content-hash = "fafb334cb038533f851c23d0b63254223abf72ce4f02987e7064b0c95566699a" + +[metadata.files] diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..2fce3af --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,36 @@ +[tool.poetry] +name = "epcpy" +version = "0.1.0" +description = "A Python module for creation, validation, and transformation of EPC representations as defined in GS1's EPC Tag Data Standard (https://www.gs1.org/standards/rfid/tds)." +license = "MIT" +authors = ["Nedap Retail "] +readme = "README.md" +homepage = "https://github.com/nedap/retail-epcpy" +repository = "https://github.com/nedap/retail-epcpy" +keywords = [ + "gs1", + "epc", + "python" +] +classifiers = [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", +] + +[tool.poetry.scripts] +test = "scripts:test" + +[tool.poetry.dependencies] +python = "^3.7" + +[tool.poetry.dev-dependencies] +black = "22.1.0" + +[build-system] +requires = ["poetry-core>=1.0.0"] +build-backend = "poetry.core.masonry.api" diff --git a/scripts.py b/scripts.py new file mode 100644 index 0000000..34410e5 --- /dev/null +++ b/scripts.py @@ -0,0 +1,10 @@ +import subprocess + + +def test(): + """ + Run all unittests. Similar to: `python -m unittest discover` + """ + subprocess.run( + ['python', '-u', '-m', 'unittest', 'discover'] + )