-
Notifications
You must be signed in to change notification settings - Fork 881
setup proper pip package #2278
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
base: master
Are you sure you want to change the base?
setup proper pip package #2278
Conversation
|
not ready for review |
|
Converting to draft until it's ready for review |
|
ready now, openpilot pr: commaai/openpilot#36185 |
MANIFEST.in
Outdated
| include SConstruct | ||
| include SConscript |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't think we need these two?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't, removing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need this? we should only add top level files/dirs if absolutely needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
py.typed is required by [PEP 561] without it, type checkers like mypy treat everything as Any.
pyproject.toml
Outdated
|
|
||
| [build-system] | ||
| requires = ["setuptools>=61", "wheel"] | ||
| requires = ["setuptools>=61", "wheel", "pycryptodome >= 3.9.8", "scons", "opendbc @ git+https://github.com/commaai/opendbc.git@master#egg=opendbc",] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no way to use the dependencies declared above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried, based on my reading [project].dependencies includes deps that are required after the build whereas [build-system].requires includes deps required before the build, and as per my knowledge there is no place where we can mention deps that are common to both of these environments...these are treated as two completely different enviroments.
pyproject.toml
Outdated
| [tool.hatch.build.targets.wheel] | ||
| packages = ["src/panda"] | ||
| include = [ "include/**" | ||
| ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cleanup the formatting
| [tool.hatch.build.targets.wheel.shared-data] | ||
| "include" = "include" | ||
|
|
||
| [tool.setuptools.package-data] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't this redundant with MANIFEST.in?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
| from setuptools.command.build import build as _build | ||
|
|
||
| class build(_build): | ||
| def run(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wrong indentation
setup.py
Outdated
| class build(_build): | ||
| def run(self): | ||
| env = os.environ.copy() | ||
| env['FINAL_PROVISIONING'] = '1' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should not be set
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, removed
|
@adeebshihadeh any comments? |
|
@adeebshihadeh pinging again |
sets up a proper pip package, a .whl build for openpilot to use out of the box. includes .h and .py from the board dir, includes .py files from python dir.
issue: #2239
here all the files included in the build