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

refactor: Recursively look for the project root #2286

Merged
merged 2 commits into from
Oct 6, 2023

Conversation

xulongwu4
Copy link
Contributor

@xulongwu4 xulongwu4 commented Sep 28, 2023

Pull Request Checklist

  • A news fragment is added in news/ describing what is new.
  • Test cases added for changed code.

Describe what you have changed in this PR.

This PR refactors the find_project_root() and find_pypackage() functions so that they now recursively looks for the pyproject.toml file or the __pypackages__/{version}/lib directory in the current directory or its parent directory. This means that we no longer need to set an upper limit on the number of levels we tranverse in such a search, and the PDM_PROJECT_MAX_DEPTH environment variable and the project_max_depth setting is no longer useful.

@xulongwu4 xulongwu4 force-pushed the find-pypackages-directory branch 3 times, most recently from 35c9c82 to 616119c Compare September 28, 2023 20:43
@xulongwu4 xulongwu4 marked this pull request as draft September 28, 2023 21:06
@xulongwu4 xulongwu4 force-pushed the find-pypackages-directory branch from 616119c to 57917d3 Compare September 29, 2023 01:52
@codecov
Copy link

codecov bot commented Sep 29, 2023

Codecov Report

All modified lines are covered by tests ✅

Files Coverage Δ
src/pdm/project/config.py 88.37% <ø> (ø)
src/pdm/project/core.py 89.32% <100.00%> (ø)
src/pdm/utils.py 84.58% <100.00%> (-0.19%) ⬇️

📢 Thoughts on this report? Let us know!.

@xulongwu4 xulongwu4 marked this pull request as ready for review September 29, 2023 02:03
Copy link
Collaborator

@frostming frostming left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a news fragment under news/?

@xulongwu4
Copy link
Contributor Author

Added a news fragment

@xulongwu4 xulongwu4 requested a review from frostming September 29, 2023 03:03
@frostming frostming merged commit 530f28d into pdm-project:main Oct 6, 2023
23 checks passed
@drunkwcodes
Copy link
Contributor

Well done, @xulongwu4 !
mojo-muse also appreciate your work.

@j178 j178 mentioned this pull request Apr 3, 2024
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

Successfully merging this pull request may close these issues.

3 participants