Don't know if this is more of a python or Dagster ...
# ask-community
c
Don't know if this is more of a python or Dagster question, but.... is there an easy way with Dagster, when using more than one code location, to make a custom function available to all code location and their modules/sub-modules? Or do I have to write and install a package?
🤖 1
d
If your code locations live in the same monorepo, you can install a package from local path. Otherwise, you can install the common package from
git+https
or
git+ssh
. I advise to publish it a private PyPI properly tho, this way different code locations don't need to be in sync with the common package version all the time. Installing from
git
would allow this too but it's a little harder to configure for docker builds etc
❤️ 1
c
They don't live in the same monorepo, unfortunately... they're all in separate repos and deployed in docker containers.
d
^ added comments about
git+...
installtion
c
Thank you, Daniel!
I was hoping Dagster had some type of official extension system that I didn't know about. 🙂
a
For what it’s worth we are doing the
git
way from Daniel’s solutions with some code that is used in different services across our systems. It’s doable but currently requires manually updating Dockerfiles with the latest version of the package, so it’s not as nice as pinning some version range in a requirements.txt. But it’s usable still.
👍 1
d
you can use
git+
with requirements.txt as well as with Poetry
shouldn't be a problem with that
a
Yes, that’s right. I think we had some other reasons (unrelated to this question) why we went for adding it in the Dockerfile, so just ignore the dockerfile part.
But if you want to control what version package you install from the repo via
git+
(eg. from
release/...
branches) you’ll end up manually updating your requirements.txt too.
d
yes