From 755f413fce81d9e02c1b30c6ba5248a4d8c04e4a Mon Sep 17 00:00:00 2001 From: niels <51261230+nmakel@users.noreply.github.com> Date: Thu, 8 Apr 2021 21:04:07 +0200 Subject: [PATCH] move to more standard project structure --- Makefile | 17 ++++++++++++ pyproject.toml | 6 ++++ setup.cfg | 32 ++++++++++++++++++++++ setup.py | 30 +------------------- {sdm_modbus => src/sdm_modbus}/__init__.py | 0 5 files changed, 56 insertions(+), 29 deletions(-) create mode 100644 Makefile create mode 100644 pyproject.toml create mode 100644 setup.cfg rename {sdm_modbus => src/sdm_modbus}/__init__.py (100%) diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..ae77b6a --- /dev/null +++ b/Makefile @@ -0,0 +1,17 @@ +all: lint + +.PHONY: lint +lint: + flake8 --ignore=E501,W503 + +.PHONY: release +release: + python3 -m build + python3 -m twine upload dist/* + +clean: + find . -type f -name *.pyc -delete + find . -type d -name __pycache__ -delete + rm -rf build + rm -rf dist + rm -rf *.egg-info \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..b5a3c46 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,6 @@ +[build-system] +requires = [ + "setuptools>=42", + "wheel" +] +build-backend = "setuptools.build_meta" \ No newline at end of file diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..5f15164 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,32 @@ +[metadata] +name = sdm_modbus +version = 0.4.4 +author = m,ale; +author_email = +description = Eastron SDM Modbus parser library +long_description = file: README.md +long_description_content_type = text/markdown +license = MIT License +url = https://github.com/nmakel/sdm_modbus +project_urls = + Bug Tracker = https://github.com/nmakel/sdm_modbus/issues +classifiers = + Development Status :: 4 - Beta + Programming Language :: Python :: 3.7 + Operating System :: OS Independent + Environment :: Console + Natural Language :: English + Intended Audience :: Developers + License :: OSI Approved :: MIT License + +[options] +package_dir = + = src +packages = find: +include_package_data = True +python_requires = >= 3.7 +install_requires = + pymodbus >= 2.3.0 + +[options.packages.find] +where = src \ No newline at end of file diff --git a/setup.py b/setup.py index a70da02..5bce6c2 100755 --- a/setup.py +++ b/setup.py @@ -2,32 +2,4 @@ import setuptools - -with open("README.md", "r") as fh: - long_description = fh.read() - -setuptools.setup( - name="sdm_modbus", - version="0.4.4", - description="Eastron SDM Modbus parser library", - long_description=long_description, - long_description_content_type="text/markdown", - license="MIT License", - author="nmakel", - author_email="", - url="https://github.com/nmakel/sdm_modbus", - packages=["sdm_modbus"], - include_package_data=True, - install_requires=[ - "pymodbus>=2.3.0" - ], - classifiers=[ - "Development Status :: 4 - Beta", - "Programming Language :: Python :: 3.7", - "Operating System :: OS Independent", - "Environment :: Console", - "Natural Language :: English", - "Intended Audience :: Developers", - "License :: OSI Approved :: MIT License" - ] -) +setuptools.setup() diff --git a/sdm_modbus/__init__.py b/src/sdm_modbus/__init__.py similarity index 100% rename from sdm_modbus/__init__.py rename to src/sdm_modbus/__init__.py