diff --git a/.flake8 b/.flake8 new file mode 100644 index 0000000..7e1499d --- /dev/null +++ b/.flake8 @@ -0,0 +1,4 @@ +[flake8] +extend-ignore = E203,E501,E701 +max-line-length = 88 +exclude = [".eggs"] diff --git a/.gitignore b/.gitignore index e6cfb60..f256bd1 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ !.gitignore !.github !.readthedocs.yaml +!.flake8 # Byte / compiled / optimized *.py[cod] diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e9ce193..3f674e9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -20,7 +20,7 @@ To be sure all HDF5 files are compliant with the latest standard ```bash pip install -e .[dev] -./converted/generate.sh +./nxxas_examples/generate.sh ``` ### Linting diff --git a/doc/conf.py b/doc/conf.py index 65445f0..2c6734c 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -6,13 +6,15 @@ import os import sys -from pynxxas import __version__ as release +from importlib.metadata import version as get_version + +release = get_version("pynxxas") sys.path.append(os.path.abspath("./_ext")) project = "pynxxas" version = ".".join(release.split(".")[:2]) -copyright = "2024-present, ESRF" +copyright = "2024-2025, ESRF" author = "ESRF" docstitle = f"{project} {version}" diff --git a/pyproject.toml b/pyproject.toml index 14ad32c..63a9125 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,4 +2,62 @@ requires = [ "setuptools>=46.4" ] -build-backend = "setuptools.build_meta" \ No newline at end of file +build-backend = "setuptools.build_meta" + +[project] +name = "pynxxas" +version = "0.0.1a" +authors = [{name = "ESRF", email = "dau-pydev@esrf.fr"}] +description = "Read and write XAS data in NeXus format" +readme = {file = "README.md", content-type = "text/markdown"} +license = {file = "LICENSE"} +classifiers = [ + "Intended Audience :: Science/Research", + "License :: OSI Approved :: MIT License", + "Programming Language :: Python :: 3", +] +requires-python = ">=3.8" +dependencies = [ + "numpy", + "h5py", + "pydantic >=2.6", + "pint >=0.24.4", + "charset_normalizer", +] + +[project.urls] +Homepage = "https://github.com/XraySpectroscopy/pynxxas/" +Documentation = "https://pynxxas.readthedocs.io/" +Repository = "https://github.com/XraySpectroscopy/pynxxas/" +Issues = "https://github.com/XraySpectroscopy/pynxxas/issues" +Changelog = "https://github.com/XraySpectroscopy/pynxxas/-/blob/main/CHANGELOG.md" + +[project.optional-dependencies] +test = [ + "pytest >=7", +] +dev = [ + "pynxxas[test]", + "black >=22", + "flake8 >=4", + "xraylarch", +] +doc = [ + "pynxxas[test]", + "sphinx >=4.5", + "sphinx-autodoc-typehints >=1.16", + "pydata-sphinx-theme < 0.15", + "xraylarch", +] + +[tool.setuptools] +package-dir = { "" = "src" } + +[tool.setuptools.packages.find] +where = ["src"] + +[tool.coverage.run] +omit = ['*/tests/*'] + +[project.scripts] +nxxas-convert = "pynxxas.apps.nxxas_convert:main" diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index f24dd09..0000000 --- a/setup.cfg +++ /dev/null @@ -1,70 +0,0 @@ -[metadata] -name = pynxxas -version = attr: pynxxas.__version__ -author = ESRF -author_email = wout.de_nolf@esrf.fr -description = Read and write XAS data in NeXus -long_description = file: README.md -long_description_content_type = text/markdown -license = MIT -url = https://github.com/XraySpectroscopy/pynxxas/ -project_urls = - Source = https://github.com/XraySpectroscopy/pynxxas/ - Documentation = https://pynxxas.readthedocs.io/ - Tracker = https://github.com/XraySpectroscopy/pynxxas/issues/ -classifiers = - Intended Audience :: Science/Research - License :: OSI Approved :: MIT License - Programming Language :: Python :: 3 - -[options] -package_dir= - =src -packages=find: -python_requires = >=3.9 -install_requires = - numpy - h5py - pydantic >=2.6 - pint >=0.24.4 - charset_normalizer - -[options.packages.find] -where=src - -[options.extras_require] -test = - pytest >=7 -dev = - %(test)s - black >=22 - flake8 >=4 - xraylarch -doc = - %(test)s - sphinx >=4.5 - sphinx-autodoc-typehints >=1.16 - pydata-sphinx-theme < 0.15 - xraylarch - -[options.entry_points] -console_scripts = - nxxas-convert=pynxxas.apps.nxxas_convert:main - -# E501 (line too long) ignored for now -# E203 and W503 incompatible with black formatting (https://black.readthedocs.io/en/stable/compatible_configs.html#flake8) -[flake8] -ignore = E501, E203, W503 -max-line-length = 88 -exclude = - .eggs - -# E402 (module import not at top of file) ignored -[flake8_nb] -ignore = E501, E203, W503, E402 -max-line-length = 88 - -[coverage:run] -omit = - setup.py - */tests/* diff --git a/setup.py b/setup.py deleted file mode 100644 index 1abbd06..0000000 --- a/setup.py +++ /dev/null @@ -1,4 +0,0 @@ -import setuptools - -if __name__ == "__main__": - setuptools.setup() diff --git a/src/pynxxas/__init__.py b/src/pynxxas/__init__.py index 3047ba3..e69de29 100644 --- a/src/pynxxas/__init__.py +++ b/src/pynxxas/__init__.py @@ -1 +0,0 @@ -__version__ = "0.0.1a"