From b25c0a82ad47f75478fdc223eef2e9c3683d7457 Mon Sep 17 00:00:00 2001 From: Fernando Date: Wed, 11 Jun 2025 11:15:21 -0300 Subject: [PATCH 1/6] MNT: modernize Install. --- Makefile | 4 +--- pyproject.toml | 45 +++++++++++++++++++++++++++++++++++++++++++++ setup.py | 7 ++++--- 3 files changed, 50 insertions(+), 6 deletions(-) create mode 100644 pyproject.toml 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..ec02335 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,45 @@ +[build-system] +requires = ["setuptools>=44"] +build-backend = "setuptools.build_meta" + +[project] +name = "imaids" +authors = [{ name = "lnls-ima" } ] +maintainers = [ + {name = "Gabriel Rezende de Ascenção", email = "gabriel.ascencao@lnls.br"}, + {name = "Lucas Francisco"}, +] +description = "Insertion Devices Package" +readme = "README.md" +dynamic = ["version", "dependencies"] +requires-python = ">=3.6" +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-ima/insertion-devices" +Download = "https://github.com/lnls-ima/insertion-devices" +Repository = "https://github.com/lnls-ima/insertion-devices.git" +Issues = "https://github.com/lnls-ima/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 index 6e0c37d..b2037be 100644 --- a/setup.py +++ b/setup.py @@ -1,12 +1,13 @@ """Setup module.""" +import pathlib + from setuptools import setup -import pkg_resources def get_abs_path(relative): - """Get absolute path of file.""" - return pkg_resources.resource_filename(__name__, relative) + """.""" + return str(pathlib.Path(__file__).parent / relative) with open(get_abs_path("README.md"), "r") as _f: From d839b8b7296f5a80ba996b52b2a35c08a3c680c6 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Tue, 1 Jul 2025 10:25:19 -0300 Subject: [PATCH 2/6] update pyproject.toml --- pyproject.toml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index ec02335..d65d932 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,8 +6,9 @@ build-backend = "setuptools.build_meta" name = "imaids" authors = [{ name = "lnls-ima" } ] maintainers = [ - {name = "Gabriel Rezende de Ascenção", email = "gabriel.ascencao@lnls.br"}, - {name = "Lucas Francisco"}, + {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" @@ -24,10 +25,10 @@ license = "MIT" license-files= [ "LICENSE", ] [project.urls] -Homepage = "https://github.com/lnls-ima/insertion-devices" -Download = "https://github.com/lnls-ima/insertion-devices" -Repository = "https://github.com/lnls-ima/insertion-devices.git" -Issues = "https://github.com/lnls-ima/insertion-devices/issues" +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"] From b084f9d412b7186e97c1eade72b8353bbfb8867e Mon Sep 17 00:00:00 2001 From: Gabriel Date: Tue, 1 Jul 2025 10:45:32 -0300 Subject: [PATCH 3/6] delete setup.py --- setup.py | 45 --------------------------------------------- 1 file changed, 45 deletions(-) delete mode 100644 setup.py diff --git a/setup.py b/setup.py deleted file mode 100644 index b2037be..0000000 --- a/setup.py +++ /dev/null @@ -1,45 +0,0 @@ -"""Setup module.""" - -import pathlib - -from setuptools import setup - - -def get_abs_path(relative): - """.""" - return str(pathlib.Path(__file__).parent / 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) From 0f8294e142a4b0fa8d03fadb5c5c3835ca810d32 Mon Sep 17 00:00:00 2001 From: Gabrielrezende-asc <99893658+Gabrielrezende-asc@users.noreply.github.com> Date: Tue, 1 Jul 2025 10:52:28 -0300 Subject: [PATCH 4/6] Update pyproject.toml Co-authored-by: fernandohds564 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index d65d932..a85cd50 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools>=44"] +requires = ["setuptools>=60"] build-backend = "setuptools.build_meta" [project] From 633242ca95a9c86b3e7e0d587ca1a09120287666 Mon Sep 17 00:00:00 2001 From: Gabrielrezende-asc <99893658+Gabrielrezende-asc@users.noreply.github.com> Date: Tue, 1 Jul 2025 10:53:07 -0300 Subject: [PATCH 5/6] Update pyproject.toml Co-authored-by: fernandohds564 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index a85cd50..d9dfc9a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,7 +13,7 @@ maintainers = [ description = "Insertion Devices Package" readme = "README.md" dynamic = ["version", "dependencies"] -requires-python = ">=3.6" +requires-python = ">=3.9" classifiers = [ "Intended Audience :: Science/Research", "Programming Language :: Python", From 1fb97c5731d143d6428be4d585d8629763c55482 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Tue, 1 Jul 2025 10:54:54 -0300 Subject: [PATCH 6/6] update authors --- pyproject.toml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index d9dfc9a..f62a395 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,9 @@ build-backend = "setuptools.build_meta" [project] name = "imaids" -authors = [{ name = "lnls-ima" } ] +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"},