Skip to content
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

Fix Readme and add some additional make commands #91

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

pierceroberts
Copy link

in reference to this issue.
#89

@pierceroberts
Copy link
Author

@fhenneke Here is the PR.
So I guess this the best I can do!

Also looks like there is no ci/cd. Not sure if you all are trying to do that but we could open up another ticket for!

Please leave comments if you need to, thanks!

Copy link
Contributor

@fhenneke fhenneke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @pierceroberts,
thanks for taking a stab at fixing the README. It really helps to have other people try out the code and propose instructions which would have helped them get it running.

The main issue I still have with the PR is the proposed use of pyenv. I cannot judge the benefits of this tool compared to things like uv, or if we should move to something more feature rich like poetry.

The fastest way to get the PR merged would be to remove the part on handling the python version. Most other comments should be straight forward to address.

If you want to push for a different tool to managing python (and/or package dependencies), you would have to provide more argument and also convince @harisang.

cc @alex-zadorozhnyi

Comment on lines +56 to +60
To run the unittests you can use the make target unittest `make unittest`, however you might have a couple issues:
- You might run into the issue of the binary package for psycopg not being installed simply run:
```sh
pip install "psycopg[binary,pool]"
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did this fail for you in a fresh environment? Then we should add it explicitly to requirements.in. Good catch!

Do we need only the binary or both binary and pool?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It did not fail on pip install but it failed when I went to run the tests.
Personally I have only used psycopg2 because it's the newer version so I would advocate for that.
I haven't used psycopg3, but that is the newer version of psycopg2 as well. So maybe we could consider that?
here are the docs:
https://pypi.org/project/psycopg2/

I also had a question as to how you all are handling migrations are you using alembic or something?

@@ -2,6 +2,11 @@ DOCKER_IMAGE_NAME=test_db_image
DOCKER_CONTAINER_NAME=test_db_container
DB_PORT=5432

# Might be worth using poetry here so you can install packages in the venv and then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have a preference between poetry, uv, hatch, pyenv, or our approach with venv + pip + pip-tools?

I would like to keep external tools a minimum for now, and consistent with https://github.com/cowprotocol/solver-rewards and https://github.com/cowprotocol/ebbo.

We have discussed moving to some other tool but could not agree on one with good trade off of ease of use and added robustness.

Copy link
Author

@pierceroberts pierceroberts Feb 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So as I mentioned in my other reply, pyenv is just for versioning. Poetry is for package management which replaces requirements.txt and creates a poetry.toml and poetry.lock file.
I am unsure on uv or hatch so I'll have to read into those.

I'd say requirements.txt does the job, but poetry is probably an upgrade.

@@ -20,4 +25,7 @@ stop_test_db:
docker rm $(DOCKER_CONTAINER_NAME) || true
docker rmi $(DOCKER_IMAGE_NAME) || true

unittest:
pytest tests/unit

.PHONY: install imbalances daemon test_db run_test_db stop_test_db clean
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those new commands should probably also be added here, right?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can, but basically what the .PHONY represents is a way for make to determine what are make commands and what are files. If you have a file named install then make would be confused. If your targets are unique, you can avoid this.
Here is a stackoverflow post to help understand.
https://stackoverflow.com/questions/2145590/what-is-the-purpose-of-phony-in-a-makefile

@pierceroberts
Copy link
Author

Thanks for the feedback @fhenneke !
I'll make the few changes you suggested and then wait for your response on the more elaborate topics.
As you mentioned my first wack at things coming in blind lol.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants