mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
Python: CG trace: Move code to src/
As recommended in https://blog.ionelmc.ro/2014/05/25/python-packaging/ and following pattern of black and pytest
This commit is contained in:
@@ -2,6 +2,6 @@
|
||||
cg-trace-example-db/
|
||||
|
||||
# Artifact from building `pip install -e .`
|
||||
cg_trace.egg-info/
|
||||
src/cg_trace.egg-info/
|
||||
|
||||
venv/
|
||||
|
||||
@@ -40,7 +40,10 @@ After following setup instructions below, run the `recreate-db.sh` script to cre
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.organizeImports": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"python.autoComplete.extraPaths": [
|
||||
"src"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -1,16 +1,14 @@
|
||||
from setuptools import find_packages, setup
|
||||
|
||||
from cg_trace import MIN_PYTHON_VERSION_FORMATTED, __version__
|
||||
|
||||
# TODO: There was some benefit of structuring your code as `src/yourpackage/code.py`
|
||||
# instead of `yourpackage/code.py` concerning imports, but I don't recall the details
|
||||
# using src/ folder as recommended in: https://blog.ionelmc.ro/2014/05/25/python-packaging/
|
||||
|
||||
setup(
|
||||
name="cg_trace",
|
||||
version=__version__,
|
||||
version="0.0.1",
|
||||
description="Call graph tracing",
|
||||
packages=find_packages(),
|
||||
packages=find_packages("src"),
|
||||
package_dir={"": "src"},
|
||||
install_requires=["lxml"],
|
||||
entry_points={"console_scripts": ["cg-trace = cg_trace.main:main"]},
|
||||
python_requires=">={}".format(MIN_PYTHON_VERSION_FORMATTED),
|
||||
python_requires=">=3.6",
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user