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

Python Package Setup with Toml #4

Merged
merged 3 commits into from
Jul 1, 2024
Merged

Conversation

himanshunaidu
Copy link
Contributor

No description provided.

@himanshunaidu himanshunaidu added the DO NOT MERGE Do not merge this code label Jun 29, 2024
"pandas>=2.2.2",
"matplotlib>=3.8.4",
"pgcli>=4.1.0",
"psycopg2>=2.9.9",
Copy link
Contributor Author

@himanshunaidu himanshunaidu Jun 29, 2024

Choose a reason for hiding this comment

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

It seems that to install this using pip (pip install -e .), the Windows Linux Subsystem needs to install gcc (for psycopg2).
But when installing psycopg2 through conda/mamba, we don't get an issue without gcc, because conda/mamba install the following:

The following NEW packages will be INSTALLED:

  keyutils           conda-forge/linux-64::keyutils-1.6.1-h166bdaf_0 
  krb5               conda-forge/linux-64::krb5-1.21.3-h659f571_0 
  libedit            conda-forge/linux-64::libedit-3.1.20191231-he28a2e2_2 
  libpq              conda-forge/linux-64::libpq-16.3-ha72fbe1_0 
  libstdcxx-ng       conda-forge/linux-64::libstdcxx-ng-14.1.0-hc0a3c3a_0 
  psycopg2           conda-forge/linux-64::psycopg2-2.9.9-py312h08590aa_0 
  python_abi         conda-forge/linux-64::python_abi-3.12-4_cp312

Copy link
Contributor

Choose a reason for hiding this comment

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

If you are managing your environment using conda/mamba you should run pip install --no-deps -e . so that pip doesn't mess up the dependencies. It's best not to let pip mess with the conda/mamba installation.

Copy link
Contributor Author

@himanshunaidu himanshunaidu Jun 30, 2024

Choose a reason for hiding this comment

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

Got it. That makes sense.
I assume we will have to test on how this works in a pure Python environment (or virtualenv) as well, for comprehensiveness.
Just to make sure the setup works everywhere.

Currently, this has been tested by me only for the following 2 approaches, both related to conda/mamba:

  1. (Assuming gcc is installed) Create a conda environment, install pip in the environment, and then directly install transit_equity with dependencies with pip install -e .
  2. Create a conda environment using orca.yaml and then install transit_equity with pip install --no-deps -e .

Copy link
Contributor

Choose a reason for hiding this comment

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

This is fine for now. Later if we want we can set up some continuous integration jobs to test all of these things.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For everyone else's reference, please follow the Method 2. in your own environments, except instead of orca.yaml, use the environment.yaml in the root directory of this repository.
We will have to remember to keep the environment.yaml file updated.

@himanshunaidu
Copy link
Contributor Author

The current versions I have specified are too strict. We may want to figure out more relaxed versions so that people can work in older Python environments if really required.

@himanshunaidu himanshunaidu removed the DO NOT MERGE Do not merge this code label Jul 1, 2024
Copy link
Contributor

@bhazelton bhazelton left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

@himanshunaidu himanshunaidu merged commit 2e2d2e8 into main Jul 1, 2024
@himanshunaidu himanshunaidu deleted the scratch/package_setup branch July 1, 2024 19:20
@himanshunaidu himanshunaidu linked an issue Jul 3, 2024 that may be closed by this pull request
tatasky09 pushed a commit that referenced this pull request Jul 15, 2024
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.

feat: Add toml file for Python package setup.
2 participants