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

a way to import modules from the project root in pdm_build.py #245

Closed
DetachHead opened this issue Jun 16, 2024 · 3 comments
Closed

a way to import modules from the project root in pdm_build.py #245

DetachHead opened this issue Jun 16, 2024 · 3 comments

Comments

@DetachHead
Copy link
Contributor

Is your feature/enhancement proposal related to a problem? Please describe.

i want my pdm_build.py to be able to import from other modules in my project, but this doesn't seem to be possible.

# ./foo.py
foo = 1
# ./pdm_build.py
from foo import foo

but when running pdm install, the foo module seems inaccessible from pdm_build.py:

ModuleNotFoundError: No module named 'foo'

Describe the solution you'd like

a way to make other modules in my project accessible from pdm_build.py

@frostming frostming transferred this issue from pdm-project/pdm Jun 17, 2024
@frostming
Copy link
Contributor

Move backend-related issues to the correct repo

cutoffthetop referenced this issue in robert-koch-institut/mex-backend Jul 1, 2024
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [pdm-backend](https://togithub.com/pdm-project/pdm-backend) |
build-system.requires | patch | `==2.3.0` -> `==2.3.1` |

---

### Release Notes

<details>
<summary>pdm-project/pdm-backend (pdm-backend)</summary>

###
[`v2.3.1`](https://togithub.com/pdm-project/pdm-backend/releases/tag/2.3.1)

[Compare
Source](https://togithub.com/pdm-project/pdm-backend/compare/2.3.0...2.3.1)

#####    🐞 Bug Fixes

- Handle unexpected hg repo when parse scm version  -  by
[@&#8203;huxuan](https://togithub.com/huxuan) in
[https://github.com/pdm-project/pdm-backend/issues/237](https://togithub.com/pdm-project/pdm-backend/issues/237)
[<samp>(d6fec)</samp>](https://togithub.com/pdm-project/pdm-backend/commit/d6feccf)
- Treat PDM_BUILD_SCM_VERSION empty string as unset  -  by
[@&#8203;ryukinix](https://togithub.com/ryukinix) in
[https://github.com/pdm-project/pdm-backend/issues/238](https://togithub.com/pdm-project/pdm-backend/issues/238)
[<samp>(596f1)</samp>](https://togithub.com/pdm-project/pdm-backend/commit/596f1dc)
- Honor the current working directory when importing pdm_build.py Close
[#&#8203;245](https://togithub.com/pdm-project/pdm-backend/issues/245)
 -  by [@&#8203;frostming](https://togithub.com/frostming) in
[https://github.com/pdm-project/pdm-backend/issues/245](https://togithub.com/pdm-project/pdm-backend/issues/245)
[<samp>(ba98c)</samp>](https://togithub.com/pdm-project/pdm-backend/commit/ba98c85)
- Errors when using the `editables` backend with the `includes` field.
Fixes
[#&#8203;242](https://togithub.com/pdm-project/pdm-backend/issues/242)
 -  by [@&#8203;frostming](https://togithub.com/frostming) in
[https://github.com/pdm-project/pdm-backend/issues/242](https://togithub.com/pdm-project/pdm-backend/issues/242)
[<samp>(59396)</samp>](https://togithub.com/pdm-project/pdm-backend/commit/59396e3)
- Vendor editables  -  by
[@&#8203;frostming](https://togithub.com/frostming)
[<samp>(95da7)</samp>](https://togithub.com/pdm-project/pdm-backend/commit/95da73a)

#####     [View changes on
GitHub](https://togithub.com/pdm-project/pdm-backend/compare/2.3.0...2.3.1)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://togithub.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MTcuMSIsInVwZGF0ZWRJblZlciI6IjM3LjQxNy4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
@DetachHead
Copy link
Contributor Author

i think the reason this wasn't working for me was because i needed to include that module in source-includes:

[tool.pdm.build]
source-includes = ["foo"]

@frostming
Copy link
Contributor

i think the reason this wasn't working for me was because i needed to include that module in source-includes:

Probably not, use includes instead. Read this section for the difference.

cutoffthetop referenced this issue in robert-koch-institut/mex-common Jul 8, 2024
This PR contains the following updates:

| Package | Type | Update | Change | Pending |
|---|---|---|---|---|
| [pdm-backend](https://togithub.com/pdm-project/pdm-backend) |
build-system.requires | patch | `==2.3.0` -> `==2.3.1` | `2.3.2` |

---

### Release Notes

<details>
<summary>pdm-project/pdm-backend (pdm-backend)</summary>

###
[`v2.3.1`](https://togithub.com/pdm-project/pdm-backend/releases/tag/2.3.1)

[Compare
Source](https://togithub.com/pdm-project/pdm-backend/compare/2.3.0...2.3.1)

#####    🐞 Bug Fixes

- Handle unexpected hg repo when parse scm version  -  by
[@&#8203;huxuan](https://togithub.com/huxuan) in
[https://github.com/pdm-project/pdm-backend/issues/237](https://togithub.com/pdm-project/pdm-backend/issues/237)
[<samp>(d6fec)</samp>](https://togithub.com/pdm-project/pdm-backend/commit/d6feccf)
- Treat PDM_BUILD_SCM_VERSION empty string as unset  -  by
[@&#8203;ryukinix](https://togithub.com/ryukinix) in
[https://github.com/pdm-project/pdm-backend/issues/238](https://togithub.com/pdm-project/pdm-backend/issues/238)
[<samp>(596f1)</samp>](https://togithub.com/pdm-project/pdm-backend/commit/596f1dc)
- Honor the current working directory when importing pdm_build.py Close
[#&#8203;245](https://togithub.com/pdm-project/pdm-backend/issues/245)
 -  by [@&#8203;frostming](https://togithub.com/frostming) in
[https://github.com/pdm-project/pdm-backend/issues/245](https://togithub.com/pdm-project/pdm-backend/issues/245)
[<samp>(ba98c)</samp>](https://togithub.com/pdm-project/pdm-backend/commit/ba98c85)
- Errors when using the `editables` backend with the `includes` field.
Fixes
[#&#8203;242](https://togithub.com/pdm-project/pdm-backend/issues/242)
 -  by [@&#8203;frostming](https://togithub.com/frostming) in
[https://github.com/pdm-project/pdm-backend/issues/242](https://togithub.com/pdm-project/pdm-backend/issues/242)
[<samp>(59396)</samp>](https://togithub.com/pdm-project/pdm-backend/commit/59396e3)
- Vendor editables  -  by
[@&#8203;frostming](https://togithub.com/frostming)
[<samp>(95da7)</samp>](https://togithub.com/pdm-project/pdm-backend/commit/95da73a)

#####     [View changes on
GitHub](https://togithub.com/pdm-project/pdm-backend/compare/2.3.0...2.3.1)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://togithub.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MTcuMSIsInVwZGF0ZWRJblZlciI6IjM3LjQyNS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
erichesse referenced this issue in robert-koch-institut/mex-extractors Jul 8, 2024
This PR contains the following updates:

| Package | Type | Update | Change | Pending |
|---|---|---|---|---|
| [pdm-backend](https://togithub.com/pdm-project/pdm-backend) |
build-system.requires | patch | `==2.3.0` -> `==2.3.1` | `2.3.2` |

---

### Release Notes

<details>
<summary>pdm-project/pdm-backend (pdm-backend)</summary>

###
[`v2.3.1`](https://togithub.com/pdm-project/pdm-backend/releases/tag/2.3.1)

[Compare
Source](https://togithub.com/pdm-project/pdm-backend/compare/2.3.0...2.3.1)

#####    🐞 Bug Fixes

- Handle unexpected hg repo when parse scm version  -  by
[@&#8203;huxuan](https://togithub.com/huxuan) in
[https://github.com/pdm-project/pdm-backend/issues/237](https://togithub.com/pdm-project/pdm-backend/issues/237)
[<samp>(d6fec)</samp>](https://togithub.com/pdm-project/pdm-backend/commit/d6feccf)
- Treat PDM_BUILD_SCM_VERSION empty string as unset  -  by
[@&#8203;ryukinix](https://togithub.com/ryukinix) in
[https://github.com/pdm-project/pdm-backend/issues/238](https://togithub.com/pdm-project/pdm-backend/issues/238)
[<samp>(596f1)</samp>](https://togithub.com/pdm-project/pdm-backend/commit/596f1dc)
- Honor the current working directory when importing pdm_build.py Close
[#&#8203;245](https://togithub.com/pdm-project/pdm-backend/issues/245)
 -  by [@&#8203;frostming](https://togithub.com/frostming) in
[https://github.com/pdm-project/pdm-backend/issues/245](https://togithub.com/pdm-project/pdm-backend/issues/245)
[<samp>(ba98c)</samp>](https://togithub.com/pdm-project/pdm-backend/commit/ba98c85)
- Errors when using the `editables` backend with the `includes` field.
Fixes
[#&#8203;242](https://togithub.com/pdm-project/pdm-backend/issues/242)
 -  by [@&#8203;frostming](https://togithub.com/frostming) in
[https://github.com/pdm-project/pdm-backend/issues/242](https://togithub.com/pdm-project/pdm-backend/issues/242)
[<samp>(59396)</samp>](https://togithub.com/pdm-project/pdm-backend/commit/59396e3)
- Vendor editables  -  by
[@&#8203;frostming](https://togithub.com/frostming)
[<samp>(95da7)</samp>](https://togithub.com/pdm-project/pdm-backend/commit/95da73a)

#####     [View changes on
GitHub](https://togithub.com/pdm-project/pdm-backend/compare/2.3.0...2.3.1)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://togithub.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MTcuMSIsInVwZGF0ZWRJblZlciI6IjM3LjQyNS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Co-authored-by: erichesse <[email protected]>
erichesse referenced this issue in robert-koch-institut/mex-model Jul 9, 2024
This PR contains the following updates:

| Package | Type | Update | Change | Pending |
|---|---|---|---|---|
| [pdm-backend](https://togithub.com/pdm-project/pdm-backend) |
build-system.requires | patch | `==2.3.0` -> `==2.3.1` | `2.3.2` |

---

### Release Notes

<details>
<summary>pdm-project/pdm-backend (pdm-backend)</summary>

###
[`v2.3.1`](https://togithub.com/pdm-project/pdm-backend/releases/tag/2.3.1)

[Compare
Source](https://togithub.com/pdm-project/pdm-backend/compare/2.3.0...2.3.1)

#####    🐞 Bug Fixes

- Handle unexpected hg repo when parse scm version  -  by
[@&#8203;huxuan](https://togithub.com/huxuan) in
[https://github.com/pdm-project/pdm-backend/issues/237](https://togithub.com/pdm-project/pdm-backend/issues/237)
[<samp>(d6fec)</samp>](https://togithub.com/pdm-project/pdm-backend/commit/d6feccf)
- Treat PDM_BUILD_SCM_VERSION empty string as unset  -  by
[@&#8203;ryukinix](https://togithub.com/ryukinix) in
[https://github.com/pdm-project/pdm-backend/issues/238](https://togithub.com/pdm-project/pdm-backend/issues/238)
[<samp>(596f1)</samp>](https://togithub.com/pdm-project/pdm-backend/commit/596f1dc)
- Honor the current working directory when importing pdm_build.py Close
[#&#8203;245](https://togithub.com/pdm-project/pdm-backend/issues/245)
 -  by [@&#8203;frostming](https://togithub.com/frostming) in
[https://github.com/pdm-project/pdm-backend/issues/245](https://togithub.com/pdm-project/pdm-backend/issues/245)
[<samp>(ba98c)</samp>](https://togithub.com/pdm-project/pdm-backend/commit/ba98c85)
- Errors when using the `editables` backend with the `includes` field.
Fixes
[#&#8203;242](https://togithub.com/pdm-project/pdm-backend/issues/242)
 -  by [@&#8203;frostming](https://togithub.com/frostming) in
[https://github.com/pdm-project/pdm-backend/issues/242](https://togithub.com/pdm-project/pdm-backend/issues/242)
[<samp>(59396)</samp>](https://togithub.com/pdm-project/pdm-backend/commit/59396e3)
- Vendor editables  -  by
[@&#8203;frostming](https://togithub.com/frostming)
[<samp>(95da7)</samp>](https://togithub.com/pdm-project/pdm-backend/commit/95da73a)

#####     [View changes on
GitHub](https://togithub.com/pdm-project/pdm-backend/compare/2.3.0...2.3.1)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://togithub.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MTcuMSIsInVwZGF0ZWRJblZlciI6IjM3LjQyNS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Co-authored-by: erichesse <[email protected]>
cutoffthetop referenced this issue in robert-koch-institut/mex-editor Jul 12, 2024
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [pdm-backend](https://togithub.com/pdm-project/pdm-backend) |
build-system.requires | patch | `==2.3.0` -> `==2.3.2` |

---

### Release Notes

<details>
<summary>pdm-project/pdm-backend (pdm-backend)</summary>

###
[`v2.3.2`](https://togithub.com/pdm-project/pdm-backend/releases/tag/2.3.2)

[Compare
Source](https://togithub.com/pdm-project/pdm-backend/compare/2.3.1...2.3.2)

#####    🐞 Bug Fixes

- Detect src layout only if it exists and included by build config  - 
by [@&#8203;frostming](https://togithub.com/frostming)
[<samp>(9466c)</samp>](https://togithub.com/pdm-project/pdm-backend/commit/9466c66)
- Use compatible is_relative_to for Python 3.8  -  by
[@&#8203;frostming](https://togithub.com/frostming)
[<samp>(30c46)</samp>](https://togithub.com/pdm-project/pdm-backend/commit/30c4614)

#####    📝 Documentation

- Update the logo url  -  by
[@&#8203;frostming](https://togithub.com/frostming)
[<samp>(fd5ef)</samp>](https://togithub.com/pdm-project/pdm-backend/commit/fd5eff3)

#####     [View changes on
GitHub](https://togithub.com/pdm-project/pdm-backend/compare/2.3.1...2.3.2)

###
[`v2.3.1`](https://togithub.com/pdm-project/pdm-backend/releases/tag/2.3.1)

[Compare
Source](https://togithub.com/pdm-project/pdm-backend/compare/2.3.0...2.3.1)

#####    🐞 Bug Fixes

- Handle unexpected hg repo when parse scm version  -  by
[@&#8203;huxuan](https://togithub.com/huxuan) in
[https://github.com/pdm-project/pdm-backend/issues/237](https://togithub.com/pdm-project/pdm-backend/issues/237)
[<samp>(d6fec)</samp>](https://togithub.com/pdm-project/pdm-backend/commit/d6feccf)
- Treat PDM_BUILD_SCM_VERSION empty string as unset  -  by
[@&#8203;ryukinix](https://togithub.com/ryukinix) in
[https://github.com/pdm-project/pdm-backend/issues/238](https://togithub.com/pdm-project/pdm-backend/issues/238)
[<samp>(596f1)</samp>](https://togithub.com/pdm-project/pdm-backend/commit/596f1dc)
- Honor the current working directory when importing pdm_build.py Close
[#&#8203;245](https://togithub.com/pdm-project/pdm-backend/issues/245)
 -  by [@&#8203;frostming](https://togithub.com/frostming) in
[https://github.com/pdm-project/pdm-backend/issues/245](https://togithub.com/pdm-project/pdm-backend/issues/245)
[<samp>(ba98c)</samp>](https://togithub.com/pdm-project/pdm-backend/commit/ba98c85)
- Errors when using the `editables` backend with the `includes` field.
Fixes
[#&#8203;242](https://togithub.com/pdm-project/pdm-backend/issues/242)
 -  by [@&#8203;frostming](https://togithub.com/frostming) in
[https://github.com/pdm-project/pdm-backend/issues/242](https://togithub.com/pdm-project/pdm-backend/issues/242)
[<samp>(59396)</samp>](https://togithub.com/pdm-project/pdm-backend/commit/59396e3)
- Vendor editables  -  by
[@&#8203;frostming](https://togithub.com/frostming)
[<samp>(95da7)</samp>](https://togithub.com/pdm-project/pdm-backend/commit/95da73a)

#####     [View changes on
GitHub](https://togithub.com/pdm-project/pdm-backend/compare/2.3.0...2.3.1)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://togithub.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MTcuMSIsInVwZGF0ZWRJblZlciI6IjM3LjQyOS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants