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

Feat: Python project outline #26

Merged
merged 3 commits into from
Dec 5, 2024
Merged

Feat: Python project outline #26

merged 3 commits into from
Dec 5, 2024

Conversation

lalver1
Copy link
Member

@lalver1 lalver1 commented Dec 4, 2024

Closes #4

This PR prepares the outline for a Python project

  • Set up pyproject.toml with project metadata, dependencies, and build system
  • Set up init.py (and ready for dynamic package versioning)
  • Install devcontainer requirements from pyproject.toml
  • devcontainer is updated to use TOML VSCode extension

@lalver1 lalver1 self-assigned this Dec 4, 2024
@lalver1
Copy link
Member Author

lalver1 commented Dec 4, 2024

@thekaveman if you try to build the dev container it'll fail and you'll prob see this error: LookupError: setuptools-scm was unable to detect version for /home/caltrans/src.

I was at least expecting to see /home/caltrans/src/pems somewhere and I was pretty sure that we had all that is needed for setuptools_scm but I'm clearly missing something.

I tried to isolate the problem and the container builds fine if I remove "setuptools_scm>=8" from the dev dependencies

"setuptools_scm>=8"

and "setuptools-scm>=8" from the build system

requires = ["setuptools>=75", "setuptools-scm>=8"]

Then from inside the container I can

pip install setuptools_scm
python -m setuptools_scm

and I can see that at least the commit shows up in the version string, but the container is failing to build 🤔

install devcontainer requirements from pyproject.toml
devcontainer updated with TOML VSCode extension
__init__.py ready for dynamic package versioning
pyproject.toml with project metadata, dependencies, and build system
@thekaveman
Copy link
Member

thekaveman commented Dec 4, 2024

@lalver1 I think this is probably because the .git directory is not available during Docker build time, right?

For now let's just hardcode a version like version = "0.0.1" instead of dynamic = ["version"].

We can come back to the dynamic version in #10

Currently the .git directory is not available during Docker build time, so setuptools-scm returns an error. Dynamic versioning will be added later.
@lalver1 lalver1 force-pushed the feat/python-project-outline branch from 8290130 to 79cd7b3 Compare December 5, 2024 14:47
@lalver1
Copy link
Member Author

lalver1 commented Dec 5, 2024

Yep, I think that's the reason, the .git directory is not available during Docker build time.

So I hardcoded version = "0.0.1" instead of dynamic = ["version"] but I still got the same error. However, when I removed "setuptools-scm>=8" from the build system's requirements, the container built.

If it's ok, I removed all references tosetuptools-scm in 79cd7b3, that way all the changes related to dynamic versioning will be in #10 when we come back to it.

@lalver1 lalver1 marked this pull request as ready for review December 5, 2024 14:50
@lalver1 lalver1 requested a review from a team as a code owner December 5, 2024 14:50
pyproject.toml Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
Copy link
Member

@thekaveman thekaveman left a comment

Choose a reason for hiding this comment

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

Nice 👍 🐍

@lalver1 lalver1 merged commit 4b61b59 into main Dec 5, 2024
1 check passed
@lalver1 lalver1 deleted the feat/python-project-outline branch December 5, 2024 19:17
@thekaveman thekaveman added this to the Initial project setup milestone Dec 10, 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.

Create python project outline
2 participants