Skip to content

Commit 846b124

Browse files
authored
Merge pull request queens-py#174 from gilrrei/move_to_src_layout
refactor: move to src layout
2 parents 2b36e7f + a278e1d commit 846b124

File tree

206 files changed

+87
-118
lines changed

Some content is hidden

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

206 files changed

+87
-118
lines changed

.github/workflows/build_documentation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
PYTHON_PACKAGE_MANAGER: ${{steps.environment.outputs.ppm}}
3030
run: |
3131
$PYTHON_PACKAGE_MANAGER activate queens
32-
sphinx-apidoc -o doc/source queens -f -M
32+
sphinx-apidoc -o doc/source src/queens -f -M
3333
cd doc
3434
sphinx-build -b html -d build/doctrees source build/html
3535
- name: Upload html

.github/workflows/tests_local.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,23 +42,23 @@ jobs:
4242
$PYTHON_PACKAGE_MANAGER activate queens
4343
4444
echo "::group::Run isort..."
45-
isort --check-only queens tests
45+
isort --check-only src/* tests
4646
echo "::endgroup::"
4747
4848
echo "::group::Run black..."
49-
black --check queens tests
49+
black --check src/* tests
5050
echo "::endgroup::"
5151
5252
echo "::group::Run pylint..."
53-
pylint --rcfile=.pylintrc --disable=duplicate-code queens tests
53+
pylint --rcfile=.pylintrc --disable=duplicate-code src/ tests
5454
echo "::endgroup::"
5555
5656
echo "::group::Run ruff..."
5757
ruff check
5858
echo "::endgroup::"
5959
6060
# echo "::group::Create code quality report..."
61-
# pylint queens tests --rcfile=.pylintrc --output-format=json:pylint_warnings.json --fail-under 0
61+
# pylint src/ tests --rcfile=.pylintrc --output-format=json:pylint_warnings.json --fail-under 0
6262
# python .gitlab/pipeline_utils/code_quality_creator.py pylint_warnings.json
6363
# echo "::endgroup::"
6464

.gitlab/.gitlab-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ imcs-build_conda_env:
9090
- $PYTHON_PACKAGE_MANAGER create -y --prefix ./$ENV_PREFIX python=3.11 cloudpickle fabric
9191
- $PYTHON_PACKAGE_MANAGER activate ./$ENV_PREFIX
9292
- pip install -e . --no-dependencies
93-
- python queens/utils/remote_build.py
93+
- python src/queens/utils/remote_build.py
9494
--host=$REMOTE_ADDRESS --user=queens --remote-python=$REMOTE_PYTHON
9595
--remote-queens-repository=/home/queens/builds/queens-$CI_PIPELINE_ID --package-manager
9696
$PYTHON_PACKAGE_MANAGER

.pylintrc

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -587,13 +587,7 @@ ignored-checks-for-mixins=no-member,
587587
ignored-classes=optparse.Values,
588588
thread._local,
589589
_thread._local,
590-
,argparse.Namespace,
591-
queens.visualization.bmfmc_visualization,
592-
queens.visualization.bmfia_visualization,
593-
queens.visualization.grid_iterator_visualization,
594-
queens.visualization.sa_visualization,
595-
queens.visualization.surrogate_visualization,
596-
queens.visualization.variational_inference_visualization,
590+
argparse.Namespace,
597591
matplotlib.cm,
598592
logging.RootLogger,
599593

doc/README.md

Lines changed: 1 addition & 1 deletion

doc/source/_ext/create_documentation_files.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
import requests
2424

2525
from queens.utils.injector import inject
26-
from queens.utils.path import relative_path_from_queens
26+
from queens.utils.path import relative_path_from_root
2727

28-
sys.path.insert(1, str(relative_path_from_queens("test_utils").resolve()))
28+
sys.path.insert(1, str(relative_path_from_root("test_utils").resolve()))
2929
from get_queens_example_from_readme import ( # pylint: disable=import-error, wrong-import-position,wrong-import-order
3030
extract_from_markdown_file_by_marker,
3131
get_queens_example_from_readme,
@@ -54,7 +54,7 @@ def relative_to_doc_source(relative_path):
5454
Returns:
5555
pathlib.Path: Path relative from documentation
5656
"""
57-
return relative_path_from_queens("doc/source/" + relative_path)
57+
return relative_path_from_root("doc/source/" + relative_path)
5858

5959

6060
def create_tutorial_from_readme():
@@ -141,7 +141,7 @@ def clean_markdown_file(md_path, new_path):
141141
Returns:
142142
str: file name of the new markdown file
143143
"""
144-
md_text = clean_markdown(relative_path_from_queens(md_path).read_text())
144+
md_text = clean_markdown(relative_path_from_root(md_path).read_text())
145145
new_path = Path(new_path)
146146
new_path.write_text(md_text, encoding="utf-8")
147147
return new_path.name
@@ -155,12 +155,12 @@ def create_development():
155155
md_paths = []
156156
md_paths.append(
157157
clean_markdown_file(
158-
relative_path_from_queens("CONTRIBUTING.md"), relative_to_doc_source("contributing.md")
158+
relative_path_from_root("CONTRIBUTING.md"), relative_to_doc_source("contributing.md")
159159
)
160160
)
161161
md_paths.append(
162162
clean_markdown_file(
163-
relative_path_from_queens("tests/README.md"), relative_to_doc_source("testing.md")
163+
relative_path_from_root("tests/README.md"), relative_to_doc_source("testing.md")
164164
)
165165
)
166166
inject({"md_paths": md_paths}, development_template, development_path)
@@ -176,8 +176,8 @@ def extract_from_markdown_by_marker(marker_name, md_path):
176176

177177
inject(
178178
{
179-
"readme_path": relative_path_from_queens("README.md"),
180-
"contributing_path": relative_path_from_queens("CONTRIBUTING.md"),
179+
"readme_path": relative_path_from_root("README.md"),
180+
"contributing_path": relative_path_from_root("CONTRIBUTING.md"),
181181
"extract_from_markdown_by_marker": extract_from_markdown_by_marker,
182182
},
183183
intro_template,
@@ -190,7 +190,7 @@ def create_overview():
190190
overview_template = get_template_path_by_name("overview.rst.j2")
191191
overview_path = relative_to_doc_source("overview.rst")
192192

193-
queens_base_path = relative_path_from_queens("queens")
193+
queens_base_path = relative_path_from_root("src/queens")
194194

195195
def get_module_description(python_file):
196196
"""Get module description.

pyproject.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ keywords = [
2020
"bayesian inference",
2121
]
2222

23-
[tool.setuptools.packages.find]
24-
include = ["queens.*", "queens"]
25-
2623
[tool.setuptools.dynamic]
2724
version = { attr = "queens.__VERSION__" }
2825
dependencies = { file = ["requirements.in"] }
File renamed without changes.

0 commit comments

Comments
 (0)