Skip to content

Commit

Permalink
chore: change project structure (#3155)
Browse files Browse the repository at this point in the history
* chore: change project structure

Signed-off-by: Frost Ming <[email protected]>

* add news

Signed-off-by: Frost Ming <[email protected]>

* fix: coverage config

Signed-off-by: Frost Ming <[email protected]>
  • Loading branch information
frostming authored Sep 12, 2024
1 parent b448f41 commit 0ed53b6
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
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 @@ def read_version() -> str:
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()


__version__ = read_version()

0 comments on commit 0ed53b6

Please sign in to comment.