-
Notifications
You must be signed in to change notification settings - Fork 209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: install extension dependencies from requirements-lock.txt #382
base: main
Are you sure you want to change the base?
Conversation
c0a791b
to
5c69404
Compare
# install (or re-install) pgai | ||
d = version_target_dir.joinpath("ai") # delete module if exists | ||
if d.exists(): | ||
shutil.rmtree(d) | ||
for d in version_target_dir.glob( | ||
"pgai-*.dist-info" | ||
): # delete package info if exists | ||
shutil.rmtree(d) | ||
cmd = f'{bin} install -v --no-deps --compile --target "{version_target_dir}" "{ext_dir()}"' | ||
subprocess.run( | ||
cmd, | ||
check=True, | ||
shell=True, | ||
env=os.environ, | ||
cwd=str(ext_dir()), | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Re-iterating my question from the thread:
Do we actually need the code to be a package? Can't we just do pip install -r requirements-lock.py
and copy the python source files into e.g. a python directory and be done with it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TBH I don't know - what do we gain from that approach vs. this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we just do pip install -r requirements-lock.py and copy the python source files into e.g. a python directory and be done with it?
If this is what we are gonna ask users to do in case they want to use pgai library in their own code base, I don't think it is viable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, but it also doesn't make sense to have pinned/locked deps in a lib.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is to say: this approach doesn't impose our locked deps on lib users. We do still have the issue of pretty heavily-pinned deps, which we should perhaps consider relaxing a little for users of the lib.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TBH I don't know - what do we gain from that approach vs. this?
We'd remove a step from the installation, which removes the dependency of setuptools or any other build tool.
And no this has nothing to do with the pgai library. I'm just questioning if the extensions python code should rly be handled like a "library" which is what we are doing right now. Or if it actually is an application.
We realised that a pip install of the extension project does not use the locked dependencies in `requirements-lock.txt`. This change splits the `build.py install-py` step into two: first install the project's dependencies from `requiremennts-lock.txt`, then install the pgai project (without dependencies).
5c69404
to
5200b78
Compare
We realised that a pip install of the extension project does not use
the locked dependencies in
requirements-lock.txt
. This change splitsthe
build.py install-py
step into two: first install the project'sdependencies from
requiremennts-lock.txt
, then install the pgaiproject (without dependencies).