Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch qcodes to src layout #5427

Merged
merged 10 commits into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/darker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ jobs:
- uses: akaihola/[email protected]
with:
options: "--check --diff"
src: "./qcodes"
src: "./src/qcodes"
revision: "origin/main..."
version: "@e3c210b5c1b91400c3f317b2474c10ab23bec1cf"
4 changes: 2 additions & 2 deletions .github/workflows/pytest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ jobs:
if: ${{ !matrix.min-version }}
- name: Run parallel tests
run: |
pytest -m "not serial" --cov=qcodes --cov-report xml --hypothesis-profile ci --durations=20 qcodes
pytest -m "not serial" --cov=qcodes --cov-report xml --hypothesis-profile ci --durations=20 src/qcodes
# a subset of the tests fails when run in parallel on Windows so run those in serial here
- name: Run serial tests
run: |
pytest -m "serial" -n 0 --dist no --cov=qcodes --cov-report xml --cov-append --hypothesis-profile ci qcodes
pytest -m "serial" -n 0 --dist no --cov=qcodes --cov-report xml --cov-append --hypothesis-profile ci src/qcodes
- name: Upload coverage to Codecov
uses: codecov/[email protected]
with:
Expand Down
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[submodule "qcodes/tests/dataset/fixtures/db_files"]
path = qcodes/tests/dataset/fixtures/db_files
path = src/qcodes/tests/dataset/fixtures/db_files
url = https://github.com/QCoDeS/qcodes_db_fixtures.git
branch = main
[submodule "typings"]
Expand Down
11 changes: 11 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
include src/qcodes/monitor/dist/*
include src/qcodes/monitor/dist/js/*
include src/qcodes/monitor/dist/css/*
include src/qcodes/configuration/*.json
include src/qcodes/instrument/sims/*.yaml
include src/qcodes/tests/dataset/fixtures/data_2018_01_17/*/*
include src/qcodes/tests/delegate/data/*.yml
include src/qcodes/tests/drivers/auxiliary_files/*
include src/qcodes/py.typed
include src/qcodes/dist/schemas/*
include src/qcodes/dist/tests/station/*
2 changes: 1 addition & 1 deletion docs/api/configuration/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ qcodes default configuration

The following table contains the default configuration of qcodes.

.. jsonschema:: ../../../qcodes/configuration/qcodesrc_schema.json
.. jsonschema:: ../../../src/qcodes/configuration/qcodesrc_schema.json

Large diffs are not rendered by default.

96 changes: 39 additions & 57 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,9 @@ module = [
ignore_missing_imports = true

[tool.pyright]
include = ["qcodes"]
include = ["src"]
ignore = [
"qcodes/instrument_drivers/Harvard/Decadac.py",
"src/qcodes/instrument_drivers/Harvard/Decadac.py",
]
reportMissingTypeStubs = true
stubPath = "typings/stubs"
Expand Down Expand Up @@ -239,77 +239,59 @@ extend-include = ["*.ipynb"]

extend-exclude = ["typings"]

[tool.ruff.isort]

known-first-party = ["qcodes"]

[tool.ruff.per-file-ignores]
# deprecated modules left
# for backwards compatibility
"qcodes/utils/validators.py" = ["F401"]
"qcodes/utils/threading.py" = ["F401"]
"qcodes/utils/plotting.py" = ["F401"]
"qcodes/utils/metadata.py" = ["F401"]
"qcodes/utils/helpers.py" = ["F401"]
"qcodes/instrument_drivers/AimTTi/AimTTi_PL601P_channels.py" = ["F401"]
"qcodes/instrument_drivers/tektronix/Keithley_6500.py" = ["F401"]
"qcodes/instrument_drivers/tektronix/Keithley_2600_channels.py" = ["F401"]
"qcodes/instrument_drivers/tektronix/Keithley_2450.py" = ["F401"]
"qcodes/instrument_drivers/tektronix/keithley_7510.py" = ["F401"]
"qcodes/instrument_drivers/signal_hound/USB_SA124B.py" = ["F401"]
"qcodes/instrument_drivers/rohde_schwarz/RTE1000.py" = ["F401"]
"qcodes/instrument_drivers/rigol/DS4000.py" = ["F401"]
"qcodes/instrument_drivers/rigol/DG4000.py" = ["F401"]
"qcodes/instrument_drivers/rigol/DP832.py" = ["F401"]
"qcodes/instrument_drivers/rigol/DP831.py" = ["F401"]
"qcodes/instrument_drivers/rigol/DP821.py" = ["F401"]
"qcodes/instrument_drivers/rigol/DS1074Z.py" = ["F401"]
"qcodes/instrument_drivers/rigol/DG1062.py" = ["F401"]
"qcodes/instrument_drivers/devices.py" = ["F401"]
"qcodes/instrument_drivers/basel/sp983c_remote.py" = ["F401"]
"qcodes/instrument_drivers/Lakeshore/Model_325.py" = ["F401"]
"qcodes/instrument_drivers/Lakeshore/Model_336.py" = ["F401"]
"qcodes/instrument_drivers/Lakeshore/Model_372.py" = ["F401"]
"qcodes/instrument_drivers/Minicircuits/RUDAT_13G_90.py" = ["F401"]
"qcodes/instrument_drivers/HP/HP8133A.py" = ["F401"]
"qcodes/instrument_drivers/HP/HP8753D.py" = ["F401"]
"qcodes/instrument_drivers/Keysight/N9030B.py" = ["F401"]

"qcodes/instrument_drivers/Keysight/KtM960x.py" = ["F405"]
"qcodes/instrument_drivers/Keysight/KtMAwg.py" = ["F405"]
"src/qcodes/utils/validators.py" = ["F401"]
"src/qcodes/utils/threading.py" = ["F401"]
"src/qcodes/utils/plotting.py" = ["F401"]
"src/qcodes/utils/metadata.py" = ["F401"]
"src/qcodes/utils/helpers.py" = ["F401"]
"src/qcodes/instrument_drivers/AimTTi/AimTTi_PL601P_channels.py" = ["F401"]
"src/qcodes/instrument_drivers/tektronix/Keithley_6500.py" = ["F401"]
"src/qcodes/instrument_drivers/tektronix/Keithley_2600_channels.py" = ["F401"]
"src/qcodes/instrument_drivers/tektronix/Keithley_2450.py" = ["F401"]
"src/qcodes/instrument_drivers/tektronix/keithley_7510.py" = ["F401"]
"src/qcodes/instrument_drivers/signal_hound/USB_SA124B.py" = ["F401"]
"src/qcodes/instrument_drivers/rohde_schwarz/RTE1000.py" = ["F401"]
"src/qcodes/instrument_drivers/rigol/DS4000.py" = ["F401"]
"src/qcodes/instrument_drivers/rigol/DG4000.py" = ["F401"]
"src/qcodes/instrument_drivers/rigol/DP832.py" = ["F401"]
"src/qcodes/instrument_drivers/rigol/DP831.py" = ["F401"]
"src/qcodes/instrument_drivers/rigol/DP821.py" = ["F401"]
"src/qcodes/instrument_drivers/rigol/DS1074Z.py" = ["F401"]
"src/qcodes/instrument_drivers/rigol/DG1062.py" = ["F401"]
"src/qcodes/instrument_drivers/devices.py" = ["F401"]
"src/qcodes/instrument_drivers/basel/sp983c_remote.py" = ["F401"]
"src/qcodes/instrument_drivers/Lakeshore/Model_325.py" = ["F401"]
"src/qcodes/instrument_drivers/Lakeshore/Model_336.py" = ["F401"]
"src/qcodes/instrument_drivers/Lakeshore/Model_372.py" = ["F401"]
"src/qcodes/instrument_drivers/Minicircuits/RUDAT_13G_90.py" = ["F401"]
"src/qcodes/instrument_drivers/HP/HP8133A.py" = ["F401"]
"src/qcodes/instrument_drivers/HP/HP8753D.py" = ["F401"]
"src/qcodes/instrument_drivers/Keysight/N9030B.py" = ["F401"]

"src/qcodes/instrument_drivers/Keysight/KtM960x.py" = ["F405"]
"src/qcodes/instrument_drivers/Keysight/KtMAwg.py" = ["F405"]

# This triggeres in notebooks even with a md cell at the top
"*.ipynb" = ["E402"]

# these imports are fine at module level
# in tests and examples
"docs/*" = ["TID253"]
"qcodes/tests/*" = ["TID253"]
"src/qcodes/tests/*" = ["TID253"]

[tool.ruff.flake8-tidy-imports]
# There modules are relatively slow to import
# and only required in specific places so
# don't import them at module level
banned-module-level-imports = ["xarray", "pandas", "opencensus"]

[tool.setuptools]
zip-safe = false
include-package-data = false

[tool.setuptools.packages]
find = {namespaces = false}

[tool.setuptools.package-data]
qcodes = [
"monitor/dist/*",
"monitor/dist/js/*",
"monitor/dist/css/*",
"configuration/*.json",
"instrument/sims/*.yaml",
"tests/dataset/fixtures/data_2018_01_17/*/*",
"tests/delegate/data/*.yml",
"tests/drivers/auxiliary_files/*",
"py.typed",
"dist/schemas/*",
"dist/tests/station/*",
]

[tool.towncrier]
package = "qcodes"
name = "QCoDeS"
Expand Down Expand Up @@ -344,5 +326,5 @@ method = "git"
match = ["v*"]

[tool.versioningit.onbuild]
source-file = "qcodes/_version.py"
source-file = "src/qcodes/_version.py"
build-file = "qcodes/_version.py"
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion qcodes/_version.py → src/qcodes/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def _get_version() -> str:

module_path = files(root_module)
if isinstance(module_path, Path):
return versioningit.get_version(project_dir=Path(module_path).parent)
return versioningit.get_version(project_dir=Path(module_path).parent.parent)
else:
return "0.0"

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading
Loading