From e2cd4ad54733c7cb122a0c41842984d790d7e168 Mon Sep 17 00:00:00 2001 From: Fernando Date: Wed, 4 Jun 2025 16:58:04 -0300 Subject: [PATCH 1/7] MNT: create pyproject.toml and remove setup.py. --- INSTALL | 33 ---------------------------- pyproject.toml | 39 +++++++++++++++++++++++++++++++++ setup.py | 59 -------------------------------------------------- 3 files changed, 39 insertions(+), 92 deletions(-) delete mode 100644 INSTALL create mode 100644 pyproject.toml delete mode 100755 setup.py diff --git a/INSTALL b/INSTALL deleted file mode 100644 index 43c355b..0000000 --- a/INSTALL +++ /dev/null @@ -1,33 +0,0 @@ -INSTALL - pyaccel -================= - -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 -============ - -- trackcpp C++/Python package 3.3 (>=3.3.0) -- numpy 1.8 (>=1.8.2) -- mathphys 0.7 (>=0.7.0) -- matplotlib 1.4 (>=1.4.2) [Optional for graphics and interactive modules] - - -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. diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..a8e1207 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,39 @@ +[build-system] +requires = ["setuptools>=64"] +build-backend = "setuptools.build_meta" + +[project] +name = "pyaccel" +authors = [{ name = "lnls-fac" } ] +description = "High level Accelerator Physics package" +readme = "README.md" +dynamic = ["version"] +requires-python = ">=3.6" +classifiers = [ + "Intended Audience :: Science/Research", + "Programming Language :: Python", + "Topic :: Scientific/Engineering", +] +license = "MIT" +license-files= [ "LICENSE", ] +dependencies = [ + "trackcpp>=4.10.5", + "numpy>=1.8", + "mathphys>=0.7", + "matplotlib>=1.4", +] + +[project.urls] +Homepage = "https://github.com/lnls-fac/pyaccel" +Download = "https://github.com/lnls-fac/pyaccel" + +# --- Configurações específicas do Setuptools --- +[tool.setuptools] +include-package-data = true + +[tool.setuptools.dynamic] +version = { file = "VERSION" } + +[tool.setuptools.package-data] +pyaccel = ["VERSION", "data/d_touschek.npz"] + diff --git a/setup.py b/setup.py deleted file mode 100755 index 7d3bdc8..0000000 --- a/setup.py +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/env python-sirius - -import pkg_resources -from setuptools import find_packages, setup -from distutils.version import StrictVersion - - -trackcpp_version = '4.10.5' - -try: - import trackcpp -except ImportError: - raise RuntimeError("trackcpp package not found") - -if StrictVersion(trackcpp.__version__) < StrictVersion(trackcpp_version): - msg = ("trackcpp package version must be >= " + trackcpp_version + - " (version installed is " + trackcpp.__version__ + ")") - raise RuntimeError(msg) - - -def get_abs_path(relative): - 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("VERSION"), "r") as _f: - __version__ = _f.read().strip() - - -_requirements = ['', ] -#with open(get_abs_path("requirements.txt"), "r") as _f: -# _requirements = _f.read().strip().split("\n") - - -setup( - name='pyaccel', - version=__version__, - author='lnls-fac', - description='High level Accelerator Physics package', - long_description=_long_description, - long_description_content_type='text/markdown', - url='https://github.com/lnls-fac/pyaccel', - download_url='https://github.com/lnls-fac/pyaccel', - license='MIT License', - classifiers=[ - 'Intended Audience :: Science/Research', - 'Programming Language :: Python', - 'Topic :: Scientific/Engineering' - ], - packages=find_packages(), - install_requires=_requirements, - package_data={'pyaccel': ['VERSION', 'data/d_touschek.npz']}, - include_package_data=True, - python_requires=">=3.6", - zip_safe=False, - ) From c103813fd098fda21384fb57560973e21b9222f0 Mon Sep 17 00:00:00 2001 From: Fernando Date: Wed, 4 Jun 2025 17:31:14 -0300 Subject: [PATCH 2/7] MNT: return setup.py --- pyproject.toml | 2 +- setup.py | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+), 1 deletion(-) create mode 100755 setup.py diff --git a/pyproject.toml b/pyproject.toml index a8e1207..233771c 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] diff --git a/setup.py b/setup.py new file mode 100755 index 0000000..7d3bdc8 --- /dev/null +++ b/setup.py @@ -0,0 +1,59 @@ +#!/usr/bin/env python-sirius + +import pkg_resources +from setuptools import find_packages, setup +from distutils.version import StrictVersion + + +trackcpp_version = '4.10.5' + +try: + import trackcpp +except ImportError: + raise RuntimeError("trackcpp package not found") + +if StrictVersion(trackcpp.__version__) < StrictVersion(trackcpp_version): + msg = ("trackcpp package version must be >= " + trackcpp_version + + " (version installed is " + trackcpp.__version__ + ")") + raise RuntimeError(msg) + + +def get_abs_path(relative): + 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("VERSION"), "r") as _f: + __version__ = _f.read().strip() + + +_requirements = ['', ] +#with open(get_abs_path("requirements.txt"), "r") as _f: +# _requirements = _f.read().strip().split("\n") + + +setup( + name='pyaccel', + version=__version__, + author='lnls-fac', + description='High level Accelerator Physics package', + long_description=_long_description, + long_description_content_type='text/markdown', + url='https://github.com/lnls-fac/pyaccel', + download_url='https://github.com/lnls-fac/pyaccel', + license='MIT License', + classifiers=[ + 'Intended Audience :: Science/Research', + 'Programming Language :: Python', + 'Topic :: Scientific/Engineering' + ], + packages=find_packages(), + install_requires=_requirements, + package_data={'pyaccel': ['VERSION', 'data/d_touschek.npz']}, + include_package_data=True, + python_requires=">=3.6", + zip_safe=False, + ) From 5865713ef27425deaf79bdd3cda0dec8ea13d6b0 Mon Sep 17 00:00:00 2001 From: Fernando Date: Wed, 4 Jun 2025 17:37:37 -0300 Subject: [PATCH 3/7] MNT: compatilize setup.py and pyproject.toml --- pyproject.toml | 9 ++------- requirements.txt | 4 ++++ setup.py | 23 ++++------------------- 3 files changed, 10 insertions(+), 26 deletions(-) create mode 100644 requirements.txt diff --git a/pyproject.toml b/pyproject.toml index 233771c..e4c156b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ name = "pyaccel" authors = [{ name = "lnls-fac" } ] description = "High level Accelerator Physics package" readme = "README.md" -dynamic = ["version"] +dynamic = ["version", "dependencies"] requires-python = ">=3.6" classifiers = [ "Intended Audience :: Science/Research", @@ -16,12 +16,6 @@ classifiers = [ ] license = "MIT" license-files= [ "LICENSE", ] -dependencies = [ - "trackcpp>=4.10.5", - "numpy>=1.8", - "mathphys>=0.7", - "matplotlib>=1.4", -] [project.urls] Homepage = "https://github.com/lnls-fac/pyaccel" @@ -33,6 +27,7 @@ include-package-data = true [tool.setuptools.dynamic] version = { file = "VERSION" } +dependencies = { file = "requirements.txt" } [tool.setuptools.package-data] pyaccel = ["VERSION", "data/d_touschek.npz"] diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..6f54cad --- /dev/null +++ b/requirements.txt @@ -0,0 +1,4 @@ +trackcpp>=4.10.5 +numpy>=1.8 +mathphys>=0.7 +matplotlib>=1.4 diff --git a/setup.py b/setup.py index 7d3bdc8..17dd4af 100755 --- a/setup.py +++ b/setup.py @@ -1,25 +1,11 @@ #!/usr/bin/env python-sirius -import pkg_resources +import pathlib from setuptools import find_packages, setup -from distutils.version import StrictVersion - - -trackcpp_version = '4.10.5' - -try: - import trackcpp -except ImportError: - raise RuntimeError("trackcpp package not found") - -if StrictVersion(trackcpp.__version__) < StrictVersion(trackcpp_version): - msg = ("trackcpp package version must be >= " + trackcpp_version + - " (version installed is " + trackcpp.__version__ + ")") - raise RuntimeError(msg) def get_abs_path(relative): - return pkg_resources.resource_filename(__name__, relative) + return str(pathlib.Path(__file__).parent / relative) with open(get_abs_path("README.md"), "r") as _f: @@ -30,9 +16,8 @@ def get_abs_path(relative): __version__ = _f.read().strip() -_requirements = ['', ] -#with open(get_abs_path("requirements.txt"), "r") as _f: -# _requirements = _f.read().strip().split("\n") +with open(get_abs_path("requirements.txt"), "r") as _f: + _requirements = _f.read().strip().split("\n") setup( From c624ad665ec55aa7f9f23ec764280a33527e2367 Mon Sep 17 00:00:00 2001 From: Fernando Date: Thu, 5 Jun 2025 16:05:42 -0300 Subject: [PATCH 4/7] BUG: remove extra identation. --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 17dd4af..155c5a6 100755 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ def get_abs_path(relative): - return str(pathlib.Path(__file__).parent / relative) + return str(pathlib.Path(__file__).parent / relative) with open(get_abs_path("README.md"), "r") as _f: From 9a588c8b4dffe14151c4c343b6659bd5c5dd295f Mon Sep 17 00:00:00 2001 From: fernandohds564 Date: Fri, 6 Jun 2025 12:00:42 -0300 Subject: [PATCH 5/7] Update pyproject.toml --- pyproject.toml | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index e4c156b..2a7f5ba 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,6 +5,12 @@ build-backend = "setuptools.build_meta" [project] name = "pyaccel" 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 = "High level Accelerator Physics package" readme = "README.md" dynamic = ["version", "dependencies"] @@ -20,6 +26,8 @@ license-files= [ "LICENSE", ] [project.urls] Homepage = "https://github.com/lnls-fac/pyaccel" Download = "https://github.com/lnls-fac/pyaccel" +Repository = "https://github.com/lnls-fac/pyaccel.git" +Issues = "https://github.com/lnls-fac/pyaccel/issues" # --- Configurações específicas do Setuptools --- [tool.setuptools] @@ -32,3 +40,34 @@ dependencies = { file = "requirements.txt" } [tool.setuptools.package-data] pyaccel = ["VERSION", "data/d_touschek.npz"] +# --- 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 3a30ff4a120ff50808fc513c5642268082124e81 Mon Sep 17 00:00:00 2001 From: fernandohds564 Date: Fri, 6 Jun 2025 13:03:02 -0300 Subject: [PATCH 6/7] 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 2a7f5ba..dd0a323 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 = "High level Accelerator Physics package" readme = "README.md" From 8ea09d9486354778bb3fd9d6bff8e0b6f2584a99 Mon Sep 17 00:00:00 2001 From: Ana Clara Oliveira Date: Thu, 4 Dec 2025 14:00:53 -0300 Subject: [PATCH 7/7] Update version to 3.19.0 --- pyaccel/VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyaccel/VERSION b/pyaccel/VERSION index e477105..419f300 100644 --- a/pyaccel/VERSION +++ b/pyaccel/VERSION @@ -1 +1 @@ -3.18.5 +3.19.0