From d15a9a6cf33f0accdb6664274dd6139db5f9138e Mon Sep 17 00:00:00 2001 From: Fernando Date: Thu, 5 Jun 2025 18:09:05 -0300 Subject: [PATCH 1/5] MNT: Modernize Install --- INSTALL | 42 ------------------------------------------ pyproject.toml | 33 +++++++++++++++++++++++++++++++++ requirements.txt | 4 ++++ setup.py | 22 +++++++++++++++++++--- 4 files changed, 56 insertions(+), 45 deletions(-) delete mode 100644 INSTALL create mode 100644 pyproject.toml create mode 100644 requirements.txt diff --git a/INSTALL b/INSTALL deleted file mode 100644 index 07f7e0c..0000000 --- a/INSTALL +++ /dev/null @@ -1,42 +0,0 @@ -INSTALL - pymodels -================ - -This package can be installed using setuptools (>=16.0). There is no automatic -dependency checking, so read the list below and ensure necessary dependencies -are available. Developed and tested with Python 3 (3.4). - - -REQUIREMENTS -============ - -- numpy 1.8 (>=1.8.2) -- lnls 0.8 (>=0.8.0) -- mathphys 0.7 (>=0.7.0) -- pyaccel 0.12 (>=0.12.0) - - -INSTALLATION -============ - -To install to a default Python directory, run - - setup.py install - -Use the appropriate command in . Depending on permissions, it may be -necessary to run the command with sudo or as superuser. - -To install a development version, with a link to the local package files in the -default Python directory, run - - setup.py develop - -Details and further options can be found in setuptools documentation. - -To install the excitation curve files, inside the excitation_curves directory, -run - - make install - -or - - make develop diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..a42e479 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,33 @@ +[build-system] +requires = ["setuptools>=64"] +build-backend = "setuptools.build_meta" + +[project] +name = "pymodels" +authors = [ { name = "lnls-fac" }, ] +description = "PyModels lattice definitions" +readme = "README.md" +dynamic = ["version", "dependencies"] +requires-python = ">=3.6" +classifiers = [ + "Intended Audience :: Science/Research", + "Programming Language :: Python", + "Topic :: Scientific/Engineering", +] +license = "MIT" +license-files= [ "LICENSE", ] + +[project.urls] +Homepage = "https://github.com/lnls-fac/pymodels" +Download = "https://github.com/lnls-fac/pymodels" + +# --- Configurações específicas do Setuptools --- +[tool.setuptools] +include-package-data = true + +[tool.setuptools.dynamic] +version = { file = "VERSION" } +dependencies = { file = "requirements.txt" } + +[tool.setuptools.package-data] +pymodels = ["VERSION", ] diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..cf8b583 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,4 @@ +numpy>=1.8 +lnls>=0.8 +mathphys>=0.7 +pyaccel>=0.12 diff --git a/setup.py b/setup.py index 5126d86..f72f357 100755 --- a/setup.py +++ b/setup.py @@ -1,15 +1,30 @@ #!/usr/bin/env python-sirius -from setuptools import setup, find_packages +import pathlib +from setuptools import find_packages, setup -with open('VERSION','r') as _f: + +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("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='pymodels', version=__version__, author='lnls-fac', description='pyModels lattice definitions', + long_description=_long_description, url='https://github.com/lnls-fac/pymodels', download_url='https://github.com/lnls-fac/pymodels', license='MIT License', @@ -19,6 +34,7 @@ 'Topic :: Scientific/Engineering' ], packages=find_packages(), - package_data={'pymodels': ['VERSION','BO_V02A/at_flat_file_M0.txt']}, + install_requires=_requirements, + package_data={'pymodels': ['VERSION', ]}, zip_safe=False ) From 65483890e08503941ddada9b7ebf6d0783a182dd Mon Sep 17 00:00:00 2001 From: fernandohds564 Date: Thu, 5 Jun 2025 18:22:57 -0300 Subject: [PATCH 2/5] MNT: update minimal setuptools version to 44. --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index a42e479..450dc56 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools>=64"] +requires = ["setuptools>=44"] build-backend = "setuptools.build_meta" [project] From c42f801af196dca39f555e38c0a58231e1951c64 Mon Sep 17 00:00:00 2001 From: fernandohds564 Date: Fri, 6 Jun 2025 12:01:50 -0300 Subject: [PATCH 3/5] Update pyproject.toml --- pyproject.toml | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 450dc56..3c7a16d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,6 +5,12 @@ build-backend = "setuptools.build_meta" [project] name = "pymodels" authors = [ { name = "lnls-fac" }, ] +maintainers = [ + {name = "Ana Oliveira", email = "ana.clara@lnls.br"}, + {name = "Ximenes Resende", email = "xresende@gmail.com"}, + {name = "Fernando H. de Sá", email = "fernandohds564@gmail.com"}, + {name = "Murilo Barbosa Alves", email= "murilo.alves@lnls.br"} +] description = "PyModels lattice definitions" readme = "README.md" dynamic = ["version", "dependencies"] @@ -20,6 +26,8 @@ license-files= [ "LICENSE", ] [project.urls] Homepage = "https://github.com/lnls-fac/pymodels" Download = "https://github.com/lnls-fac/pymodels" +Repository = "https://github.com/lnls-fac/pymodels.git" +Issues = "https://github.com/lnls-fac/pymodels/issues" # --- Configurações específicas do Setuptools --- [tool.setuptools] @@ -31,3 +39,35 @@ dependencies = { file = "requirements.txt" } [tool.setuptools.package-data] pymodels = ["VERSION", ] + +# --- linter and formatter configurations --- +[tool.ruff] +select = [ + "W", "E", "A", "B", "C90", "D", "I002", "N", "F", "G", "ARG", "S", "NPY"] +ignore = [ + "D203", "D204", "D213", "D215", "D400", "D401", "D404", "D406", "D407", + "D408", "D409", "D413", "E203", "E226"] +ignore-init-module-imports = true +preview = true +line-length = 79 +fix = true + +[tool.ruff.extend-per-file-ignores] +"__init__.py" = ["F401", "F821"] + +[tool.ruff.format] +skip-magic-trailing-comma = true + +[tool.ruff.lint.isort] +split-on-trailing-comma = false +combine-as-imports = true + +[tool.isort] +split_on_trailing_comma = false +combine_as_imports = true +combine_star = true +multi_line_output = "HANGING_INDENT" +order_by_type = false + +[tool.black] +line-length = 79 From a5b8ac1a06604a5aa28ee6406bf439d906e5fc7f Mon Sep 17 00:00:00 2001 From: fernandohds564 Date: Fri, 6 Jun 2025 13:00:50 -0300 Subject: [PATCH 4/5] Update pyproject.toml Co-authored-by: Murilo B. Alves --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 3c7a16d..29e69dc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ maintainers = [ {name = "Ana Oliveira", email = "ana.clara@lnls.br"}, {name = "Ximenes Resende", email = "xresende@gmail.com"}, {name = "Fernando H. de Sá", email = "fernandohds564@gmail.com"}, - {name = "Murilo Barbosa Alves", email= "murilo.alves@lnls.br"} + {name = "Murilo Barbosa Alves", email= "alvesb.murilo@gmail.com"} ] description = "PyModels lattice definitions" readme = "README.md" From 8cfd22e7c7f4245097becabb336b77d37e1eefa2 Mon Sep 17 00:00:00 2001 From: Ana Clara Oliveira Date: Thu, 4 Dec 2025 14:07:14 -0300 Subject: [PATCH 5/5] Update version to 1.21.3 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 0369d0b..bae5c7f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.21.2 +1.21.3