wide-midnight-78598
07/22/2022, 1:48 PMexport
vs export-codegen
?
export
- Export Pants data for use in other tools, such as IDEs.
export-codegen
- Write generated files to dist/codegen
for use outside of Pants.
I'm missing some of the nuances as to what determines whether a new plugin should use one over the other, since they both appear to end up in the dist
folder. https://www.pantsbuild.org/docs/setting-up-an-ide has some additional examples, which are virtualenv
vs protobuf
. The best heuristic I can come up with is that export
is intended for tooling/support/not-part-of-release, while export-codegen
would represent files which would be part of the compilation/packaging/binary/production release process.
Specifically, I would wonder where the bash completions would go, and based on my assumption above, it's more likely an export
since it's sourced by the terminal, and has no part in actual production code.refined-addition-53644
07/22/2022, 2:34 PMhappy-kitchen-89482
07/22/2022, 5:11 PM--no-process-cleanup
flag, that preserves the sandbox directories (and logs their paths) so you can inspect themhappy-kitchen-89482
07/22/2022, 5:11 PMexport-codegen
goal to get generated code out of the sandbox and into dist, as mentionedhappy-kitchen-89482
07/22/2022, 5:12 PM--shell
but it sounds like --no-process-cleanup
is ~similarhappy-kitchen-89482
07/22/2022, 5:12 PMadventurous-island-11048
07/22/2022, 9:04 PM./pants tailor
I noticed it recursed down into my python package to add a BUILD
file to every level of the Python package. Is this required to have all of those BUILD
files, or can you have one for each python package?bitter-ability-32190
07/22/2022, 9:33 PMfew-arm-93065
07/22/2022, 10:42 PM[test]
use_coverage = true
[pytest]
args = ["--no-header", "-vv", "--log-cli-level", "INFO"]
[coverage-py]
report = ["html", "xml", "console"]
config="tooling_configs/.coveragerc"
When they run ./pants test
on a python tests target, pytest runs successfully, and then crashes trying to build the coverage pex:
11:08:42.69 [INFO] Completed: Run Pytest - src/stages/qc_metrics/tests/test_qc_math.py:../tests succeeded.
11:08:42.70 [INFO] Completed: Run Pytest - src/stages/qc_metrics/tests/test_qc_metrics.py:../tests succeeded.
β src/stages/qc_metrics/tests/test_qc_math.py:../tests succeeded in 4.91s (memoized).
β src/stages/qc_metrics/tests/test_qc_metrics.py:../tests succeeded in 18.90s (memoized).
Wrote test XML to `dist/test_results`
11:08:46.73 [INFO] Completed: Building coverage.pex from coverage-py_default_lockfile.txt
11:08:46.73 [ERROR] 1 Exception encountered:
ProcessExecutionFailure: Process 'Building coverage.pex from coverage-py_default_lockfile.txt' failed with exit code 1.
stdout:
(see thread for more)
Itβs very odd that itβs looking for cp38, since we are on 3.9. 3.8 is the system default. And, I donβt have this problem personally, itβs only shown up for two people, but itβs consistently reproducible for them. Theyβve already tried clearing the ~/.cache/pants directory to no effect.
Does anyone know anything about this, or have an idea how we could go about debugging it further? Any help appreciated.adventurous-island-11048
07/23/2022, 12:12 AMwitty-crayon-22786
07/23/2022, 3:35 AMfreezing-lamp-12123
07/23/2022, 12:26 PMbuild
, test
, fmt
, run
, and lint
encoded in pants? are the same knobs available for any targets?straight-action-80318
07/23/2022, 8:15 PM1.13.0.dev20220723+cu116
) my generate-lockfiles
just hangs, itβs been going 1700s now. Is this some kind of parsing thing?rhythmic-morning-87313
07/24/2022, 8:24 AMrhythmic-morning-87313
07/24/2022, 8:24 AMrhythmic-morning-87313
07/24/2022, 8:25 AMpython_executable
, in addition to mypy_path
) is very important to make mypy working with type stubs and external dependencies.rhythmic-morning-87313
07/24/2022, 8:31 AMdist/export/python/virtualenvs/python-default/3.10.5/bin/python
when changing the Python version, to avoid things like: https://github.com/lablup/backend.ai/blob/6636e3db145a9778cfed60e7b0ccd9578f0ff69b/pants.toml#L40 and letting people update their IDE/editor configurations. Probably having a symbolic link good enough?worried-painter-31382
07/24/2022, 8:38 AMsetup.cfg
[tool:pytest]
...
addopts =
-p amra.pytest.plugin.suites
When I run ./pants test
, the amra.pytest.plugin.suites
module is not found, because it is not imported in the tests.ripe-cpu-85141
07/24/2022, 10:05 PMβββ pants
βββ pants.toml
βββ py
βββ libraries
β βββ libtutu
β βββ LICENSE
β βββ pyproject.toml
β βββ README.md
β βββ setup.cfg
β βββ src
β βββ libtutu
β βββ __init__.py
βββ projects
βββ tata
β βββ LICENSE
β βββ pyproject.toml
β βββ README.md
β βββ setup.cfg
β βββ src
β βββ tata
β βββ __init__.py
βββ standalone
βββ LICENSE
βββ pyproject.toml
βββ README.md
βββ setup.cfg
βββ src
β βββ standalone
β βββ __init__.py
βββ tests
βββ test_dummy.py
Does anyone have an example I could follow for when you have the src/ and tests/ directory?ripe-cpu-85141
07/25/2022, 4:06 AMpex.result.ResultError: There were 10 errors downloading required artifacts:
1. pytest-cov 3 from <https://files.pythonhosted.org/packages/20/49/b3e0edec68d81846f519c602ac38af9db86e1e71275528b3e814ae236063/pytest_cov-3.0.0-py3-none-any.whl>
<urlopen error [Errno 104] Connection reset by peer>
2. pytest 7.0.1 from <https://files.pythonhosted.org/packages/38/93/c7c0bd1e932b287fb948eb9ce5a3d6307c9fc619db1e199f8c8bc5dad95f/pytest-7.0.1-py3-none-any.whl>
<urlopen error [Errno 104] Connection reset by peer>
3. coverage 6.3.2 from <https://files.pythonhosted.org/packages/60/a8/0f951285dff76cbedbbba89c1969586020150a3b53267b5d8674b2ead15a/coverage-6.3.2-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl>
<urlopen error [Errno 104] Connection reset by peer>
Is there another option to set?rhythmic-morning-87313
07/25/2022, 4:42 AMfierce-keyboard-91032
07/25/2022, 8:33 AMshared/utils
folder. Unfortunately the django example github does not seem to have such an example.
When I tried this naively, it seems pytest always want to import some kind of Django settings for the test.aloof-tent-90836
07/25/2022, 11:58 AMβ <test_name1>.py succeeded in 10.65s (memoized).
β <test_name2>.py succeeded in 19.10s (memoized).
Wrote test reports to .test_results
Error: 4.58 [ERROR] 1 Exception encountered:
ProcessExecutionFailure: Process 'Generate Pytest report coverage report.' failed with exit code 1.
stdout:
No data to report.
Looks like we can't gather coverage data without actual test run? Is my observation is correct? Should I create an issue on the GutHub or am I doing something wrong here?refined-addition-53644
07/25/2022, 4:34 PMAll dependencies must work with the same.resolve
nice-florist-55958
07/25/2022, 5:24 PMpex_binary
be generalized to script_binary
for dynamic scripting languages Pants doesn't support yet? I'm imagining a target with similar semantics but with just a script file entry point to be executed by the OS (and so with whatever is in the file's shebang line, i.e., the language's interpreter). Dependencies would just be other first-party source-like targets such as resources, python_sources, shell_sources, etc.
bundled as a collection of files relative to the entry script (or relocatable to it). A new target script_sources
instead of resources
as a generic stand-in could be added too.
This would allow other projects based q/kdb
, bash
, nodejs
, or any other interpreted language to formally use Pants, both to enumerate their sources and to package themselves into a single executable file. Migration would also be easier once any given language has first-class support.
At present, could the existing archive
(for the executable) and resources
(for the sources) targets be post-processed after the Pants packaging step to be executable using a given interpreter path?
At the moment, all I can think of is to lightly use Python as a glue language and package a pex_binary
with an entry point script that just sub-processes out to the actual script that the author wants executed.great-diamond-82230
07/25/2022, 7:21 PMcold-soccer-63228
07/25/2022, 7:31 PMbitter-ability-32190
07/25/2022, 8:00 PM__run.sh
?bitter-ability-32190
07/25/2022, 9:30 PMstrong-refrigerator-32393
07/26/2022, 3:29 AM