From 5c4f852a1401cc8738995992f3cb801affc757e2 Mon Sep 17 00:00:00 2001 From: Hadi Jannat Date: Sat, 20 Jul 2024 12:25:42 +0200 Subject: [PATCH] Add pyproject.toml and update setup.py for new build system --- basyx/aas/version.py | 2 ++ pyproject.toml | 52 ++++++++++++++++---------------------------- setup.py | 26 ++++++++++++++++++---- 3 files changed, 43 insertions(+), 37 deletions(-) create mode 100644 basyx/aas/version.py diff --git a/basyx/aas/version.py b/basyx/aas/version.py new file mode 100644 index 00000000..5235b333 --- /dev/null +++ b/basyx/aas/version.py @@ -0,0 +1,2 @@ +# basyx/aas/version.py +__version__ = '0.1.0' \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 499f64a2..9daea6c9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,58 +1,44 @@ [build-system] -requires = ["setuptools>=40.8.0", "wheel"] +requires = ["setuptools>=45", "wheel", "setuptools_scm[toml]>=6.2"] build-backend = "setuptools.build_meta" [project] name = "basyx-python-sdk" -version = "1.0.0" # actual version +version = "0.1.0" description = "The Eclipse BaSyx Python SDK, an implementation of the Asset Administration Shell for Industry 4.0 systems" authors = [ - {name = "The Eclipse BaSyx Authors", email = "admins@iat.rwth-aachen.de"} # actual authors + { name = "The Eclipse BaSyx Authors", email = "admins@iat.rwth-aachen.de" } ] readme = "README.md" -license = {file = "LICENSE"} +license = { file = "LICENSE" } classifiers = [ "Programming Language :: Python :: 3", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", - "Development Status :: 5 - Production/Stable", + "Development Status :: 5 - Production/Stable" ] requires-python = ">=3.8" dependencies = [ - "jsonschema~=4.7", + "python-dateutil>=2.8,<3", "lxml>=4.2,<5", - "python-dateutil>=2.8,<3.0", - "pyecma376-2>=0.2.4", "urllib3>=1.26,<2.0", - "lxml-stubs~=0.5.1", -] - -[project.optional-dependencies] -dev = [ - "pycodestyle", - "mypy", - "coverage", - "codeblocks", - "types-python-dateutil", -] - -docs = [ - "sphinx", - "sphinx-rtd-theme", - "sphinx-argparse", -] - -test = [ - "pytest", - "pytest-cov", + "pyecma376-2>=0.2.4" ] [project.urls] Homepage = "https://github.com/eclipse-basyx/basyx-python-sdk" -[tool.setuptools.packages.find] -exclude = ["test", "test.*"] +[project.scripts] +aas-compliance-check = "basyx.aas.compliance_tool.cli:main" + +[tool.setuptools] +packages = ["basyx"] [tool.setuptools.package-data] -"basyx" = ["py.typed"] -"basyx.aas.examples.data" = ["TestFile.pdf"] \ No newline at end of file +basyx = ["py.typed"] +"basyx.aas.examples.data" = ["TestFile.pdf"] + +[tool.setuptools.exclude-package-data] +"*" = ["test", "test.*"] + +[tool.setuptools_scm] diff --git a/setup.py b/setup.py index d747c6f7..7ba87f68 100644 --- a/setup.py +++ b/setup.py @@ -1,9 +1,27 @@ -from setuptools import setup, find_packages +#!/usr/bin/env python3 +# Copyright (c) 2019-2024 the Eclipse BaSyx Authors +# +# This program and the accompanying materials are made available under the terms of the MIT License, available in +# the LICENSE file of this project. +# +# SPDX-License-Identifier: MIT -# Metadata is now in pyproject.toml, but we need this file for backwards compatibility -setup( +import setuptools + +with open("README.md", "r", encoding='utf-8') as fh: + long_description = fh.read() + +setuptools.setup( name="basyx-python-sdk", - packages=find_packages(exclude=["test", "test.*"]), + # version is managed by pyproject.toml + author="The Eclipse BaSyx Authors", + description="The Eclipse BaSyx Python SDK, an implementation of the Asset Administration Shell for Industry 4.0 " + "systems", + long_description=long_description, + long_description_content_type="text/markdown", + url="https://github.com/eclipse-basyx/basyx-python-sdk", + packages=setuptools.find_packages(exclude=["test", "test.*"]), + zip_safe=False, package_data={ "basyx": ["py.typed"], "basyx.aas.examples.data": ["TestFile.pdf"],