Skip to content

Commit f7118b1

Browse files
authored
Devops: Move the source directory into src/ (#329)
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.
1 parent c18ff2e commit f7118b1

File tree

125 files changed

+9
-18
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+9
-18
lines changed

.github/workflows/validate_release_tag.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ def get_version_from_module(content: str) -> str:
3434
TAG_PREFIX = 'refs/tags/v'
3535
assert args.GITHUB_REF.startswith(TAG_PREFIX), f'GITHUB_REF should start with "{TAG_PREFIX}": {args.GITHUB_REF}'
3636
tag_version = args.GITHUB_REF[len(TAG_PREFIX) :]
37-
package_version = get_version_from_module(Path('aiida_common_workflows/__init__.py').read_text(encoding='utf-8'))
37+
package_version = get_version_from_module(
38+
Path('src/aiida_common_workflows/__init__.py').read_text(encoding='utf-8')
39+
)
3840
error_message = f'The tag version `{tag_version}` is different from the package version `{package_version}`'
3941
assert tag_version == package_version, error_message

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,9 @@ select = [
130130
[tool.ruff.format]
131131
quote-style = 'single'
132132

133+
[tool.ruff.lint.isort]
134+
known-first-party = ['src']
135+
133136
[tool.pytest.ini_options]
134137
testpaths = [
135138
'tests',

tests/cli/test_launch.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
import click
66
import pytest
7-
87
from aiida_common_workflows.cli import launch, utils
98

109

tests/cli/test_options.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,14 @@
77
import click
88
import pytest
99
from aiida import orm
10-
1110
from aiida_common_workflows.cli import options
1211

1312

1413
@pytest.fixture
1514
def filepath_cif():
1615
"""Return a path to a valid CIF file."""
1716
basepath = pathlib.Path(__file__).parent.parent.parent
18-
filepath = basepath.joinpath('aiida_common_workflows', 'common', 'data', 'Si.cif')
17+
filepath = basepath.joinpath('src', 'aiida_common_workflows', 'common', 'data', 'Si.cif')
1918
return filepath
2019

2120

tests/cli/test_plot.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
import matplotlib.pyplot as plt
66
import pytest
7-
87
from aiida_common_workflows.cli import plot
98

109

tests/cli/test_utils.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# -*- coding: utf-8 -*-
22
"""Tests for the :mod:`aiida_common_workflows.cli.utils` module."""
33
import pytest
4-
54
from aiida_common_workflows.cli.utils import get_code_from_list_or_database
65

76

tests/generators/test_generator.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import pytest
44
from aiida import orm
55
from aiida.plugins import WorkflowFactory
6-
76
from aiida_common_workflows.generators import InputGenerator
87

98

tests/protocol/test_registry.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import typing as t
44

55
import pytest
6-
76
from aiida_common_workflows.protocol import ProtocolRegistry
87

98

tests/workflows/bands/test_implementations.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
import pytest
55
from aiida import engine, orm, plugins
6-
76
from aiida_common_workflows.generators.ports import InputGeneratorPort
87
from aiida_common_workflows.plugins import get_workflow_entry_point_names
98
from aiida_common_workflows.workflows.bands.workchain import CommonBandsWorkChain

tests/workflows/bands/test_workchain.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"""Tests for the :mod:`aiida_common_workflows.workflows.bands.workchain` module."""
44
import pytest
55
from aiida.plugins import WorkflowFactory
6-
76
from aiida_common_workflows.plugins import get_workflow_entry_point_names
87
from aiida_common_workflows.workflows.bands import CommonBandsInputGenerator
98
from aiida_common_workflows.workflows.bands.workchain import CommonBandsWorkChain

tests/workflows/dissociation_curve/test_workchain_diss_curve.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
from aiida import orm
88
from aiida.engine import WorkChain
99
from aiida.plugins import WorkflowFactory
10-
1110
from aiida_common_workflows.plugins import get_workflow_entry_point_names
1211
from aiida_common_workflows.workflows import dissociation
1312
from aiida_common_workflows.workflows.relax.workchain import CommonRelaxWorkChain

tests/workflows/eos/test_workchain_eos.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
from aiida import orm
88
from aiida.engine import WorkChain
99
from aiida.plugins import WorkflowFactory
10-
1110
from aiida_common_workflows.plugins import get_workflow_entry_point_names
1211
from aiida_common_workflows.workflows import eos
1312
from aiida_common_workflows.workflows.relax.generator import RelaxType

tests/workflows/relax/test_castep.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
from aiida.orm import StructureData
99
from aiida.plugins import WorkflowFactory
1010
from aiida_castep.data.otfg import OTFGGroup
11-
from ase.build.bulk import bulk
12-
1311
from aiida_common_workflows.workflows.relax.castep.generator import (
1412
CastepCommonRelaxInputGenerator,
1513
ElectronicType,
@@ -22,6 +20,7 @@
2220
generate_inputs_relax,
2321
)
2422
from aiida_common_workflows.workflows.relax.castep.workchain import CastepCommonRelaxWorkChain
23+
from ase.build.bulk import bulk
2524

2625
WORKCHAIN = plugins.WorkflowFactory('common_workflows.relax.castep')
2726
GENERATOR = WORKCHAIN.get_input_generator()

tests/workflows/relax/test_implementations.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
import pytest
55
from aiida import engine, orm, plugins
6-
76
from aiida_common_workflows.common.types import ElectronicType, RelaxType, SpinType
87
from aiida_common_workflows.generators.ports import InputGeneratorPort
98
from aiida_common_workflows.plugins import get_workflow_entry_point_names

tests/workflows/relax/test_quantum_espresso.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33

44
import pytest
55
from aiida import engine, plugins
6-
from qe_tools import CONSTANTS
7-
86
from aiida_common_workflows.workflows.relax.generator import ElectronicType, RelaxType, SpinType
7+
from qe_tools import CONSTANTS
98

109
WORKCHAIN = plugins.WorkflowFactory('common_workflows.relax.quantum_espresso')
1110
GENERATOR = WORKCHAIN.get_input_generator()

tests/workflows/relax/test_workchain.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"""Tests for the :mod:`aiida_common_workflows.workflows.relax.workchain` module."""
44
import pytest
55
from aiida.plugins import WorkflowFactory
6-
76
from aiida_common_workflows.plugins import get_workflow_entry_point_names
87
from aiida_common_workflows.workflows.relax import CommonRelaxInputGenerator
98
from aiida_common_workflows.workflows.relax.workchain import CommonRelaxWorkChain

0 commit comments

Comments
 (0)