fast-xylophone-56613
03/27/2025, 3:42 PMwide-midnight-78598
03/27/2025, 6:21 PMpython_sources(
name="lib",
sources=["**/*.py"],
)broad-processor-92400
03/28/2025, 3:54 AMdependencies=[":lib"] will depend on all of those files
There's not a way to glob over targets, where there's separate python_sources() targets and one can write dependencies=["path/to/**:*] (or some other hypothetical syntax).
(BTW, we're happy to help you get the dependency inference working more smoothly if you'd like, but no obligation of course!)fast-xylophone-56613
03/28/2025, 9:39 AMDifferingFamiliesError: Expected AddressMaps to share the same parent directoryfast-xylophone-56613
03/28/2025, 9:42 AMapps.get_model() calls as well. There are tons of those in our code base which is why I'd prefer it (at least for now) if we could just avoid the clever clogs automated inference and just tell Pants that this code depends on that-module, the whole-module-please-don't-leave-anything-outfast-xylophone-56613
03/28/2025, 9:42 AMapps.get_model('x', 'y') translates to from x import y that might work?fast-xylophone-56613
03/28/2025, 9:44 AMwide-midnight-78598
03/28/2025, 12:10 PMwide-midnight-78598
03/28/2025, 12:12 PMfast-xylophone-56613
03/28/2025, 12:36 PMsrc/ , i.e. src/app1 src/app2 etc. Some of these are split futher like src/app1/core, src/app1/admin
I've then got a separate dir atm for web services like service/web_admin. These contain my settings files with INSTALLED_APPS, which Pants cannot read so I'm having to manually specify the apps as dependencies and I'm having trouble working out the right way to do it. I've tried specifying the directory like src/app1, and I've tried adding the individual apps.py files like src/app1/core/apps.py, which I've then overriden the dependencies of again to specify src/app1/core/migrations as a dependency of src/app1/core/apps.py.
This is all in an attempt to get manage.py migrate to actually run the migrations it's supposed to, but it usually fails saying a particular app isn't installed, which means Django couldn't find the AppConfig class for itwide-midnight-78598
03/28/2025, 12:52 PMfast-xylophone-56613
03/28/2025, 12:57 PMpython_sources(
dependencies=[
'./migrations',
],
)
In the migrations dir I also have this to include a directory of images, but I think that's by-the-by for my issue
python_sources(
dependencies=[':files'],
)
resources(
name='files',
sources=['files/**/*'],
)
And right now the web service BUILD looks something like this
python_sources(
name='lib',
dependencies=[
'//:reqs#django-cachalot',
'src/barristan/apps.py',
'src/app1/admin/apps.py',
'src/app1/core/apps.py',
'src/app2/apps.py',
],
overrides={
'manage.py': {
'dependencies': [
':lib',
'//:reqs#mysqlclient',
'./project/settings/local.py',
],
},
},
)
As mentioned above I've tried using src/app1/core inplace of the apps.py as well but no joywide-midnight-78598
03/28/2025, 1:05 PMwide-midnight-78598
03/28/2025, 1:07 PMpants peek :: correctly? As in, how do all your deps look therefast-xylophone-56613
03/28/2025, 1:08 PMfast-xylophone-56613
03/28/2025, 1:09 PMpants peek :: has an absolute fudgeton of output, is there something specific I should be looking for?fast-xylophone-56613
03/28/2025, 1:11 PMfast-xylophone-56613
03/28/2025, 1:13 PMfast-xylophone-56613
03/28/2025, 1:14 PMwide-midnight-78598
03/28/2025, 1:16 PMThis is based on https://github.com/pantsbuild/example-django/blob/main/helloworld/service/welcome/BUILDYeah, it's locally qualified vs fully qualified to settings, but it just looks odd to me. Django seems to have it's own quirks. In general, @happy-kitchen-89482 might be a better person to talk about Django specifically, as he wrote a lot of the Django stuff/example. I use FastAPI and Alembic - and the way I structure everything is slightly different, but Django's "admin" capabilities are tightly coupled, so it makes sense there is some weirdness (from my perspective) in the build
wide-midnight-78598
03/28/2025, 1:17 PMfast-xylophone-56613
03/28/2025, 1:18 PMapps.get_model() to preserve historywide-midnight-78598
03/28/2025, 1:18 PMfast-xylophone-56613
03/28/2025, 1:19 PMget_model to its relevant python filefast-xylophone-56613
03/28/2025, 1:20 PMwide-midnight-78598
03/28/2025, 1:21 PMfast-xylophone-56613
03/28/2025, 1:22 PMfast-xylophone-56613
03/28/2025, 1:23 PMpants.backend.python in my pants.toml at the momentfast-xylophone-56613
03/28/2025, 1:23 PMpants.backend.python.framework.django this whole time?wide-midnight-78598
03/28/2025, 1:24 PMwide-midnight-78598
03/28/2025, 1:24 PMfast-xylophone-56613
03/28/2025, 1:25 PMpants.backend.experimental.python.framework.django in the docs. 🧑🔬fast-xylophone-56613
03/28/2025, 1:25 PMfast-xylophone-56613
03/28/2025, 1:25 PMwide-midnight-78598
03/28/2025, 1:26 PMfast-xylophone-56613
03/28/2025, 1:31 PMfast-xylophone-56613
03/28/2025, 1:32 PMdjango.urls.include thoughhappy-kitchen-89482
03/28/2025, 6:51 PM