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

chore: change project structure #3155

Merged
merged 3 commits into from
Sep 12, 2024
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -138,4 +138,4 @@ temp.py
# Pyannotate generated stubs
type_info.json
.pdm-build/
src/pdm/models/VERSION
src/pdm/VERSION
1 change: 1 addition & 0 deletions news/3155.misc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Change the project structure to a normal package from a namespace package.
12 changes: 6 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ pdm = "pdm.core:main"

[tool.pdm.version]
source = "scm"
write_to = "pdm/models/VERSION"
write_to = "pdm/VERSION"

[tool.pdm.build]
excludes = ["./**/.git"]
Expand Down Expand Up @@ -221,12 +221,12 @@ ignore-words-list = "ba,overriden,te"

[tool.coverage.run]
branch = true
source = ["pdm/"]
source = ["pdm"]
omit = [
"pdm/__main__.py",
"pdm/pep582/sitecustomize.py",
"pdm/models/in_process/*.py",
"pdm/models/setup.py",
"*/pdm/__main__.py",
"*/pdm/pep582/sitecustomize.py",
"*/pdm/models/in_process/*.py",
"*/pdm/models/setup.py",
"*/pdm-test-*-env/*",
]

Expand Down
3 changes: 3 additions & 0 deletions src/pdm/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import pkgutil

__path__ = pkgutil.extend_path(__path__, __name__)
2 changes: 1 addition & 1 deletion src/pdm/__version__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
try:
return importlib_metadata.version(__package__ or "pdm")
except importlib_metadata.PackageNotFoundError:
return resources_read_text("pdm.models", "VERSION").strip()
return resources_read_text("pdm", "VERSION").strip()

Check warning on line 8 in src/pdm/__version__.py

View check run for this annotation

Codecov / codecov/patch

src/pdm/__version__.py#L8

Added line #L8 was not covered by tests


__version__ = read_version()
Loading