diff --git a/Makefile b/Makefile index 3e8533b..11b1202 100644 --- a/Makefile +++ b/Makefile @@ -23,8 +23,6 @@ uninstall: develop-install: develop-uninstall $(PIP) install --no-deps -e ./ -# known issue: It will fail to uninstall scripts -# if they were installed in develop mode develop-uninstall: $(PIP) uninstall -y $(PACKAGE) @@ -32,7 +30,7 @@ help: ## Show this help. @grep '##' Makefile| sed -e '/@/d' | sed -r 's,(.*?:).*##(.*),\1\2,g' dist: ## Build setuptools dist - python setup.py sdist bdist_wheel + python -m build distupload: ## Upload package dist to PyPi python -m twine upload --verbose dist/* diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..f62a395 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,48 @@ +[build-system] +requires = ["setuptools>=60"] +build-backend = "setuptools.build_meta" + +[project] +name = "imaids" +authors = [{ name = "lnls-ima" }, + { name = "lnls-ids" } + ] +maintainers = [ + {name = "Gabriel Rezende da Ascenção", email = "gabriel.ascencao@lnls.br"}, + {name = "Jefferson Barros Vieira", email = "jefferson.vieira@lnls.br"}, + {name = "Sergio Augusto Lordano Luiz", email = "sergio.lordano@lnls.br"}, +] +description = "Insertion Devices Package" +readme = "README.md" +dynamic = ["version", "dependencies"] +requires-python = ">=3.9" +classifiers = [ + "Intended Audience :: Science/Research", + "Programming Language :: Python", + "Topic :: Scientific/Engineering", +] +keywords = ["SIRIUS", "python", "Accelerator Physics", "Insertion Devices"] + +license = "MIT" +license-files= [ "LICENSE", ] + +[project.urls] +Homepage = "https://github.com/lnls-ids/insertion-devices" +Download = "https://github.com/lnls-ids/insertion-devices" +Repository = "https://github.com/lnls-ids/insertion-devices.git" +Issues = "https://github.com/lnls-ids/insertion-devices/issues" + +[project.optional-dependencies] +tests = ["nose"] + +# --- Setuptools specific configurations --- +[tool.setuptools] +packages = ["imaids"] +include-package-data = true + +[tool.setuptools.dynamic] +version = { file = "VERSION" } +dependencies = { file = "requirements.txt" } + +[tool.setuptools.package-data] +imaids = ["VERSION", "presets/*"] diff --git a/setup.py b/setup.py deleted file mode 100644 index 6e0c37d..0000000 --- a/setup.py +++ /dev/null @@ -1,44 +0,0 @@ -"""Setup module.""" - -from setuptools import setup -import pkg_resources - - -def get_abs_path(relative): - """Get absolute path of file.""" - return pkg_resources.resource_filename(__name__, relative) - - -with open(get_abs_path("README.md"), "r") as _f: - _long_description = _f.read().strip() - -with open(get_abs_path("imaids/VERSION"), "r") as _f: - __version__ = _f.read().strip() - -with open(get_abs_path("requirements.txt"), "r") as _f: - _requirements = _f.read().strip().split("\n") - - -setup( - name='imaids', - version=__version__, - author='lnls-ima', - description='Insertion devices package', - long_description=_long_description, - long_description_content_type="text/markdown", - url="https://github.com/lnls-ima/insertion-devices", - download_url="https://github.com/lnls-ima/insertion-devices", - license='MIT License', - classifiers=[ - "Intended Audience :: Science/Research", - "Programming Language :: Python", - "Topic :: Scientific/Engineering", - ], - packages=['imaids'], - package_data={ - 'imaids': ['presets/*'] - }, - install_requires=_requirements, - test_suite='nose.collector', - tests_require=['nose'], - zip_safe=False)