From 9184e7348aed94018e4b57cf0e273ef630aa4339 Mon Sep 17 00:00:00 2001 From: Lukas Pielsticker <50139597+lukaspie@users.noreply.github.com> Date: Fri, 11 Oct 2024 13:21:18 +0200 Subject: [PATCH 1/2] switch to src layout --- .github/workflows/pylint.yml | 6 +++--- docs/reference/mpes.md | 2 +- mkdocs.yaml | 2 +- pyproject.toml | 8 +++++--- {pynxtools_mpes => src/pynxtools_mpes}/__init__.py | 0 {pynxtools_mpes => src/pynxtools_mpes}/mkdocs.py | 0 {pynxtools_mpes => src/pynxtools_mpes}/reader.py | 0 7 files changed, 10 insertions(+), 8 deletions(-) rename {pynxtools_mpes => src/pynxtools_mpes}/__init__.py (100%) rename {pynxtools_mpes => src/pynxtools_mpes}/mkdocs.py (100%) rename {pynxtools_mpes => src/pynxtools_mpes}/reader.py (100%) diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index e5696a0..de851dc 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -21,10 +21,10 @@ jobs: uv pip install -r dev-requirements.txt - name: ruff check run: | - ruff check pynxtools_mpes tests + ruff check src/pynxtools_mpes tests - name: ruff format run: | - ruff format --check pynxtools_mpes tests + ruff format --check src/pynxtools_mpes tests - name: mypy run: | - mypy pynxtools_mpes tests + mypy src/pynxtools_mpes tests diff --git a/docs/reference/mpes.md b/docs/reference/mpes.md index 4d1cb7e..648d694 100644 --- a/docs/reference/mpes.md +++ b/docs/reference/mpes.md @@ -2,7 +2,7 @@ The reader supports [HDF5](https://www.hdfgroup.org/solutions/hdf5/) files created using the MPES instruments at the Department of Physical Chemistry of the [Fritz Haber Institute of the Max Planck Society (FHI)](https://pc.fhi-berlin.mpg.de). -The reader for can be found [here](https://github.com/FAIRmat-NFDI/pynxtools-mpes/blob/main/pynxtools_mpes/reader.py). +The reader for can be found [here](https://github.com/FAIRmat-NFDI/pynxtools-mpes/blob/main/src/pynxtools_mpes/reader.py). Example data for the MPES reader is available [here](https://github.com/FAIRmat-NFDI/pynxtools-mpes/tree/main/tests/data). diff --git a/mkdocs.yaml b/mkdocs.yaml index 1dc9de4..4362a0d 100644 --- a/mkdocs.yaml +++ b/mkdocs.yaml @@ -20,7 +20,7 @@ nav: plugins: - search - macros: - module_name: pynxtools_mpes/mkdocs + module_name: src/pynxtools_mpes/mkdocs theme: name: material diff --git a/pyproject.toml b/pyproject.toml index c155370..1e3b2a9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -55,13 +55,15 @@ docs = [ [project.entry-points."pynxtools.reader"] mpes = "pynxtools_mpes.reader:MPESReader" -[tool.setuptools] -packages = ["pynxtools_mpes"] +[tool.setuptools.packages.find] +where = [ + "src", +] [tool.setuptools_scm] [tool.ruff] -include = ["pynxtools_mpes/*.py", "tests/*.py"] +include = ["src/*.py", "tests/*.py"] line-length = 88 indent-width = 4 diff --git a/pynxtools_mpes/__init__.py b/src/pynxtools_mpes/__init__.py similarity index 100% rename from pynxtools_mpes/__init__.py rename to src/pynxtools_mpes/__init__.py diff --git a/pynxtools_mpes/mkdocs.py b/src/pynxtools_mpes/mkdocs.py similarity index 100% rename from pynxtools_mpes/mkdocs.py rename to src/pynxtools_mpes/mkdocs.py diff --git a/pynxtools_mpes/reader.py b/src/pynxtools_mpes/reader.py similarity index 100% rename from pynxtools_mpes/reader.py rename to src/pynxtools_mpes/reader.py From 2f81b8dbb892f94cc495826233935daf10d96623 Mon Sep 17 00:00:00 2001 From: Lukas Pielsticker <50139597+lukaspie@users.noreply.github.com> Date: Fri, 11 Oct 2024 13:59:08 +0200 Subject: [PATCH 2/2] add src in MANIFEST.IN --- MANIFEST.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MANIFEST.in b/MANIFEST.in index 4276f0d..a9131e3 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,4 +1,4 @@ prune * exclude * -recursive-include pynxtools_mpes *.py +recursive-include src/pynxtools_mpes *.py include pyproject.toml README.md dev-requirements.txt \ No newline at end of file