jolly-midnight-72759
10/29/2020, 4:05 PM./pants --no-pantsd jupyter 3rdparty/python:boto3
does not workjolly-midnight-72759
10/29/2020, 4:05 PMhundreds-father-404
10/29/2020, 4:19 PMhundreds-father-404
10/29/2020, 4:43 PMjolly-midnight-72759
10/29/2020, 4:49 PMfrom pants.base.build_environment import get_buildroot
a Pants™ approved way of getting the root of the monorepo in a plugin?jolly-midnight-72759
10/29/2020, 7:17 PMhundreds-father-404
10/29/2020, 10:19 PMjolly-midnight-72759
10/30/2020, 3:22 AMPYTHONPATH
for the app
* automatically picks the appropriate python interpreter
* sets the dashboard homepage to the top of the repo
Next improvement: allow for different Jupyter Notebook versions depending on if PY2 or PY3 was chosen.
https://gist.github.com/rcuza/bbcf8f5a13964db7760ff376649c1a44
Big thank you to @hundreds-father-404 and everyone else who helped out.flat-zoo-31952
11/05/2020, 2:00 AM./pants package --docker-image-tag="${BUILD_TAG}" $targets
./pants publish --registry=<http://my-docker-registry.company.com:5000|my-docker-registry.company.com:5000> --image-tag="${BUILD_TAG}" $targets
Big thanks to @hundreds-father-404 for the help and patience as I learned the rules APIflat-zoo-31952
11/05/2020, 4:20 PMfiles
-like dependencies...i get how to create the target type, but what kind of object do i need to return in my rule to make it available as a dependency of other targets? GeneratedSources
maybe?refined-dusk-58376
11/26/2020, 4:14 AMflat-zoo-31952
11/27/2020, 8:12 PMfast-nail-55400
12/01/2020, 3:55 AMDigest
? I see AddPrefix
and RemovePrefix
for adding and removing directory prefixes but nothing to change the filename of a file in a Digest
.jolly-midnight-72759
12/01/2020, 4:36 AMFileDigest
handle different file types, like symbolic links, sockets, etc or just text and binary files? I don't see a reason why it would, but if you do, then whatever the solution should be able to intuitively encompass filesytem api's.fast-nail-55400
12/06/2020, 4:29 AME Exception: No installed QueryRules can compute WrappedTarget given input Params(str), but it can be produced using:
E Params(Address)
I already have QueryRule(WrappedTarget, (Address,)),
in the RuleRunner
setup and my code goes from Address
to WrappedTarget
, unclear where Params(str)
is coming from, maybe not my plugin’s rules?polite-garden-50641
01/05/2021, 4:29 PMagreeable-yacht-79448
01/08/2021, 7:58 PMfrom pants.backend.python.goals.setup_py import SetupKwargsRequest
from pants.engine.target import Target
from pants.engine.rules import collect_rules
from pants.engine.unions import UnionRule
from pants.backend.python.goals.setup_py import SetupKwargs
from pants.engine.rules import rule
class CustomSetupKwargsRequest(SetupKwargsRequest):
@classmethod
def is_applicable(cls, _: Target) -> bool:
return True
@rule
async def setup_kwargs_plugin(request: CustomSetupKwargsRequest) -> SetupKwargs:
return SetupKwargs(
{**request.explicit_kwargs, "version": "1.4"}, address=request.target.address
)
def rules():
return [
*collect_rules(),
UnionRule(SetupKwargsRequest, CustomSetupKwargsRequest),
]
And my BUILD file looks like this:
python_distribution(
.....
provides=setup_py(
name="testapp",
version="1.0.3",
),
setup_py_commands=["sdist", "bdist_wheel"]
)
If I try to remove the version="1.0.3" - it complains Missing a version
kwarg in the provides
Am I missing anything?enough-analyst-54434
01/09/2021, 10:22 PMenough-postman-51783
01/12/2021, 3:49 PMrequirements.txt
files in separated folders for separated packages and with the same dependency (3rd part)? Because when I want to add the same dependency in second requirements.txt
I lose the first one. I saw in docs Dependency inference will no-op if >2 targets refer to the same file
section.enough-postman-51783
01/12/2021, 3:50 PMjolly-midnight-72759
01/12/2021, 7:02 PM[GLOBAL]
pythonpath = ["%(buildroot)s/pants-plugins"]
high-egg-2153
01/18/2021, 2:42 AM[GLOBAL]
pants_version = "2.1.1"
pythonpath = ["%(buildroot)s/plugins"]
backend_packages = [
"pants.backend.python",
"dash_app",
]
[source]
root_patterns = [
"plugins",
]
I have the follow directory structure in the repo:
plugins
BUILD
register.py
dash_app
BUILD
dash_app.py
high-egg-2153
01/18/2021, 3:38 PMenough-analyst-54434
01/23/2021, 9:14 PMField.compute_value
but we cannot do said same for a Target
as a whole. This precludes validating cross-field data until rule execution time and possibly means needing to complicate rule structure in order to DRY up this validation when the validation is in fact universal. A classic example would be mutually exclusive fields but I imagine there are other cases as well. Id there any reason not to introduce a validate
hook method on Target
called at the end of initialization that could be overridden to provide validation?flat-zoo-31952
01/27/2021, 4:30 PMbusy-lion-5707
02/10/2021, 1:20 AMmake deb
) to build a Debian package based on the Dockerfile like it was described in this blog post. I would like to use Pants (probably ./pants package
goal?) instead Makefile command to build a Debian package. My initial thought was to use Pants Docker plugin. There are two plugins:
• implemented by @magnificent-hamburger-46133 (works for Pants v1) - stored here,
• implemented by @flat-zoo-31952 (working for Pants v2) - discussed here.
Is it a good way of thinking or is there a better approach to solve it?
Here is the example repository with my problem. Thanks in advance for your opinions! 🙇♂️wonderful-iron-54019
02/19/2021, 6:09 PMlimited-insurance-37393
02/26/2021, 10:02 PMaverage-australia-85137
03/12/2021, 2:15 PMStrippedFileSources
it complains:
09:12:58.88 [ERROR] Exception caught: (pants.engine.internals.scheduler.ExecutionError)
File "/Users/nate/.cache/pants/setup/bootstrap-Darwin-x86_64/2.3.0rc1_py38/lib/python3.8/site-packages/pants/bin/local_pants_runner.py", line 246, in run
engine_result = self._perform_run(goals)
File "/Users/nate/.cache/pants/setup/bootstrap-Darwin-x86_64/2.3.0rc1_py38/lib/python3.8/site-packages/pants/bin/local_pants_runner.py", line 167, in _perform_run
return self._perform_run_body(goals, poll=False)
File "/Users/nate/.cache/pants/setup/bootstrap-Darwin-x86_64/2.3.0rc1_py38/lib/python3.8/site-packages/pants/bin/local_pants_runner.py", line 184, in _perform_run_body
return self.graph_session.run_goal_rules(
File "/Users/nate/.cache/pants/setup/bootstrap-Darwin-x86_64/2.3.0rc1_py38/lib/python3.8/site-packages/pants/init/engine_initializer.py", line 130, in run_goal_rules
exit_code = self.scheduler_session.run_goal_rule(
File "/Users/nate/.cache/pants/setup/bootstrap-Darwin-x86_64/2.3.0rc1_py38/lib/python3.8/site-packages/pants/engine/internals/scheduler.py", line 568, in run_goal_rule
self._raise_on_error([t for _, t in throws])
File "/Users/nate/.cache/pants/setup/bootstrap-Darwin-x86_64/2.3.0rc1_py38/lib/python3.8/site-packages/pants/engine/internals/scheduler.py", line 536, in _raise_on_error
raise ExecutionError(
Exception message: 1 Exception encountered:
NoSourceRootError: No source root found for `requirements.txt`. See <https://www.pantsbuild.org/v2.3/docs/source-roots> for how to define source roots.
When I get the regular merged SourceFiles however, there is nothing in the unrooted
tuple? which seems to be how I would want to detect if a particular file is in a source root or not?happy-kitchen-89482
04/02/2021, 1:20 AM