-
Notifications
You must be signed in to change notification settings - Fork 3
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
Configure the Project to be Buildable #252
Conversation
b37a918
to
ef1a6cc
Compare
@ghickman I don't have time to review this now, but we should check that IDEs understand how to install dependencies from pyproject.toml. I can check PyCharm on Monday. |
I've been testing this locally with a clean virtualenv and installing from the tarball of this branch:
|
ef1a6cc
to
ad93e75
Compare
Discussion with @bloodearnest led to:
|
027eabd
to
7de8357
Compare
@benbc – I didn't think too much about this last week, but is that a common flow? I've not come across it in Python land! I would expect it to work because the IDE must still be using a local venv/pip to install things? (surely 😰) We should still check of course 🙂 |
c6ba118
to
d18779a
Compare
To use entrypoints for a built artefact we need to be able to call the main() function directly, so we move the reading of cli args into it. However we don't want to clutter tests with mocks so this sets an empty default and only populates it if there aren't any args passed in.
d18779a
to
a785a6c
Compare
@ghickman Having looked at this a bit more, I think PyCharm is just integrating with the venv. I think it can do some pip-compile stuff too, but that's much less important. Nothing for you to worry about here. |
They were moved in as part of #252 on the basis that this was "more modern". However we don't – and don't intend to – publish ehrQL as a package to PyPI and when we do build it as a package in our Docker image we tell pip to ignore dependencies anyway. And for some reason that we haven't got to the bottom of, Dependabot is unable to update our production dependencies if we specify them in this way. This moves us back to the `requirements.prod.in` pattern that we use elsewhere and which Dependabot handles nicely. Closes #964
This sets up the requisite config to make v2 pip installable. There are a couple of commits to change how the CLI and an import work to make that happen.
I've opted to use modern build tooling because we're not tied to older python versions or environments (yet). The metadata was generated by flit locally, but we don't need it installed to build artefacts,
build
can handle that, and pip install works without either. All build metadata is contained in pyproject.toml, and documented by flit here. Production requirements have been moved to pyproject.toml, and the Justfile updated to use pyproject.toml as the spec file for pip-compiling prod requirements.