-
Notifications
You must be signed in to change notification settings - Fork 949
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
Changes from 7 commits
d8fd046
bf5956b
6fe5e5f
c489c21
041da5b
b3f487c
2a135f0
c93a96a
08e0dd2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| include SConstruct | ||
| include SConscript | ||
| recursive-include board * | ||
| recursive-include crypto * | ||
| recursive-include certs * | ||
| recursive-include tests * | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,7 +19,6 @@ dependencies = [ | |
| [project.optional-dependencies] | ||
| dev = [ | ||
| "scons", | ||
| "pycryptodome >= 3.9.8", | ||
| "cffi", | ||
| "flaky", | ||
| "pytest", | ||
|
|
@@ -34,7 +33,7 @@ dev = [ | |
| ] | ||
|
|
||
| [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",] | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no way to use the dependencies declared above?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tried, based on my reading |
||
| build-backend = "setuptools.build_meta" | ||
|
|
||
| [tool.setuptools] | ||
|
|
@@ -43,6 +42,24 @@ packages = ["panda"] | |
| [tool.setuptools.package-dir] | ||
| panda = "." | ||
|
|
||
| [tool.hatch.build.targets.wheel] | ||
| packages = ["src/panda"] | ||
| include = [ "include/**" | ||
| ] | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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] | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. isn't this redundant with MANIFEST.in?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes |
||
| panda = [ | ||
| "board/**/*.h", | ||
| "board/**/*.py", | ||
| "board/obj/**/*.bin", | ||
| "board/obj/**/*.elf", | ||
| "board/obj/**/*.bin.signed", | ||
| "python/**/*.py" | ||
| ] | ||
|
|
||
| [tool.mypy] | ||
| # third-party packages | ||
| ignore_missing_imports = true | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| import os | ||
| import subprocess | ||
| from setuptools import setup, find_packages | ||
| from setuptools.command.build import build as _build | ||
|
|
||
| class build(_build): | ||
| def run(self): | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. wrong indentation |
||
| env = os.environ.copy() | ||
| env['FINAL_PROVISIONING'] = '1' | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this should not be set
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, removed |
||
|
|
||
| project_root = os.path.abspath(os.path.dirname(__file__)) | ||
|
|
||
| print("Building firmware with scons...") | ||
|
|
||
| subprocess.check_call( | ||
| ["scons", "-j4"], | ||
| cwd=project_root, | ||
| env=env | ||
| ) | ||
|
|
||
| super().run() | ||
|
|
||
| setup( | ||
| name="pandacan", | ||
| version="0.0.10", | ||
| packages=find_packages(), | ||
| cmdclass={"build": build}, | ||
| package_data={"panda": ["py.typed"]}, | ||
| zip_safe=False, | ||
| ) | ||
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