From 24c443ed3467070ffef8a229b1b7ecedcb011418 Mon Sep 17 00:00:00 2001 From: Sebastiaan Huber Date: Fri, 22 Dec 2023 13:26:23 +0100 Subject: [PATCH] Devops: Move package into `src/` directory This package directory structure is fast becoming the standard in the Python packaging community. Even though the PyPA is not yet officially recommending it as the standard, there are various articles out there outlining the advantages of this structure over having the source folder at the root of the repository. --- .github/workflows/validate_release_tag.py | 2 +- {aiida_wien2k => src/aiida_wien2k}/__init__.py | 0 {aiida_wien2k => src/aiida_wien2k}/calculations/run123_lapw.py | 0 .../aiida_wien2k}/configs/codes/run123_lapw.yml | 0 .../aiida_wien2k}/configs/computers/localhost.yml | 0 {aiida_wien2k => src/aiida_wien2k}/parsers/scf123.py | 0 .../aiida_wien2k}/workflows/scf123_workchain.py | 0 tests/calculations/test_scf123_lapw.py | 1 - 8 files changed, 1 insertion(+), 2 deletions(-) rename {aiida_wien2k => src/aiida_wien2k}/__init__.py (100%) rename {aiida_wien2k => src/aiida_wien2k}/calculations/run123_lapw.py (100%) rename {aiida_wien2k => src/aiida_wien2k}/configs/codes/run123_lapw.yml (100%) rename {aiida_wien2k => src/aiida_wien2k}/configs/computers/localhost.yml (100%) rename {aiida_wien2k => src/aiida_wien2k}/parsers/scf123.py (100%) rename {aiida_wien2k => src/aiida_wien2k}/workflows/scf123_workchain.py (100%) diff --git a/.github/workflows/validate_release_tag.py b/.github/workflows/validate_release_tag.py index 3b224b2..5acbbb9 100644 --- a/.github/workflows/validate_release_tag.py +++ b/.github/workflows/validate_release_tag.py @@ -32,6 +32,6 @@ def get_version_from_module(content: str) -> str: args = parser.parse_args() assert args.GITHUB_REF.startswith('refs/tags/v'), f'GITHUB_REF should start with "refs/tags/v": {args.GITHUB_REF}' tag_version = args.GITHUB_REF[11:] - package_version = get_version_from_module(Path('aiida_wien2k/__init__.py').read_text(encoding='utf-8')) + package_version = get_version_from_module(Path('src/aiida_wien2k/__init__.py').read_text(encoding='utf-8')) error_message = f'The tag version `{tag_version}` is different from the package version `{package_version}`' assert tag_version == package_version, error_message diff --git a/aiida_wien2k/__init__.py b/src/aiida_wien2k/__init__.py similarity index 100% rename from aiida_wien2k/__init__.py rename to src/aiida_wien2k/__init__.py diff --git a/aiida_wien2k/calculations/run123_lapw.py b/src/aiida_wien2k/calculations/run123_lapw.py similarity index 100% rename from aiida_wien2k/calculations/run123_lapw.py rename to src/aiida_wien2k/calculations/run123_lapw.py diff --git a/aiida_wien2k/configs/codes/run123_lapw.yml b/src/aiida_wien2k/configs/codes/run123_lapw.yml similarity index 100% rename from aiida_wien2k/configs/codes/run123_lapw.yml rename to src/aiida_wien2k/configs/codes/run123_lapw.yml diff --git a/aiida_wien2k/configs/computers/localhost.yml b/src/aiida_wien2k/configs/computers/localhost.yml similarity index 100% rename from aiida_wien2k/configs/computers/localhost.yml rename to src/aiida_wien2k/configs/computers/localhost.yml diff --git a/aiida_wien2k/parsers/scf123.py b/src/aiida_wien2k/parsers/scf123.py similarity index 100% rename from aiida_wien2k/parsers/scf123.py rename to src/aiida_wien2k/parsers/scf123.py diff --git a/aiida_wien2k/workflows/scf123_workchain.py b/src/aiida_wien2k/workflows/scf123_workchain.py similarity index 100% rename from aiida_wien2k/workflows/scf123_workchain.py rename to src/aiida_wien2k/workflows/scf123_workchain.py diff --git a/tests/calculations/test_scf123_lapw.py b/tests/calculations/test_scf123_lapw.py index fd657b6..dba18dd 100644 --- a/tests/calculations/test_scf123_lapw.py +++ b/tests/calculations/test_scf123_lapw.py @@ -6,7 +6,6 @@ import pytest from aiida.orm import Dict, SinglefileData - from aiida_wien2k.calculations.run123_lapw import Wien2kRun123Lapw