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/pyaccel/VERSION b/pyaccel/VERSION index e477105..419f300 100644 --- a/pyaccel/VERSION +++ b/pyaccel/VERSION @@ -1 +1 @@ -3.18.5 +3.19.0 diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..dd0a323 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,73 @@ +[build-system] +requires = ["setuptools>=44"] +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= "alvesb.murilo@gmail.com"} +] +description = "High level Accelerator Physics package" +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/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] +include-package-data = true + +[tool.setuptools.dynamic] +version = { file = "VERSION" } +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 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 b4435eb..0fc8e6f 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(