Skip to content

chore: downgrade python requirement to 3.12#319

Merged
allison-truhlar merged 8 commits intomainfrom
downgrade-python
Mar 4, 2026
Merged

chore: downgrade python requirement to 3.12#319
allison-truhlar merged 8 commits intomainfrom
downgrade-python

Conversation

@allison-truhlar
Copy link
Collaborator

@allison-truhlar allison-truhlar commented Feb 26, 2026

This addresses issue #318

I noticed there were some unused dependencies listed under [tool.pixi.dependencies], specifically, aiosqlite and psycopg2-binary. I also removed the version requirements for httpx and lxml, as these are not direct dependencies and the required versions resolved without the listed requirements. Removing these and downgrading the Python requirement to >=3.12.0 from >=3.14.0, the application built fine and passed all tests. I manually tested the Okta login flow and it worked as well.

I tried decreasing the Python minor version to >=3.11.0, but x2s3 requires Python 3.12.*, so the dependencies could not resolve.

Edit: ultimately, only aiosqlite and lxml were removed from both the pypi dependencies list and the pixi env [tool.pixi.dependencies] list.

Restores psycopg2 package to both project dependencies and pixi dependencies
to enable PostgreSQL database connections with SQLAlchemy.

The psycopg2-binary package was removed in the Python 3.12 downgrade,
but is required for PostgreSQL support. Using psycopg2 from conda-forge
instead of psycopg2-binary to ensure compatibility with pixi.
Copy link
Member

@neomorphic neomorphic left a comment

Choose a reason for hiding this comment

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

This breaks the production deployment as we need to have the psycopg2 package installed to use postgreSQL. I have pushed an update that restores it.

@allison-truhlar allison-truhlar merged commit 581ac8f into main Mar 4, 2026
7 checks passed
@allison-truhlar allison-truhlar deleted the downgrade-python branch March 4, 2026 18:37
@will-moore
Copy link

Thanks @allison-truhlar

I tried a fresh checkout... (after renaming my previous fileglancer dir to fileglancer314)...

Something isn't happy...

$ git clone git@github.com:JaneliaSciComp/fileglancer.git
$ cd fileglancer
$ pixi run dev-install
$ pixi list     # (python 3.12 etc)

$ pixi run dev-launch
✨ Pixi task (dev-launch in default): pixi run uvicorn fileglancer.app:app --no-access-log --port 7878 --reload                                                           INFO:     Will watch for changes in these directories: ['/Users/wmoore/Desktop/FILEGLANCER/fileglancer']
INFO:     Uvicorn running on http://127.0.0.1:7878 (Press CTRL+C to quit)
INFO:     Started reloader process [15106] using WatchFiles

❌ Configuration Error:
  Value error, Add external_proxy_url to your config.yaml or FGC_EXTERNAL_PROXY_URL to your .env file

@will-moore
Copy link

However, upgrading to the pre-release version in my existing python 3.12 conda environment worked just fine...

$ conda activate fileglancer
$ python
Python 3.12.11 | packaged by Anaconda, Inc. | (main, Jun  5 2025, 08:06:15) [Clang 14.0.6 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 

$ pip freeze | grep glancer
fileglancer==2.1.2
$ pip uninstall fileglancer
$ pip install --pre fileglancer
...
Successfully installed fileglancer-2.6.0a3 psycopg2-2.9.11 uvloop-0.22.1 x2s3-1.1.1
$ fileglancer start

@will-moore
Copy link

I wonder if my issues with pixi is because of swapping old and new directories, something isn't quite a clean slate.
In any case, this issue is fixed for me since the pre-release is running on python 3.12, and I'll just continue to use my existing python 3.14 pixi environment for development...

@allison-truhlar
Copy link
Collaborator Author

@will-moore In your development set up - have you copied the server configuration file into the root of the project? This error suggests it's missing:

❌ Configuration Error:
  Value error, Add external_proxy_url to your config.yaml or FGC_EXTERNAL_PROXY_URL to your .env file

I'm glad the pre-release is working for you on Python 3.12

@will-moore
Copy link

@allison-truhlar - No I didn't copy over the config file. I don't think I needed to do that when I first ran the dev-launch a while back?
Also, the docs say right after pix run dev-install "Now you can launch the server...." and the config copying isn't mentioned until later.

But it's working fine now, thanks.

@allison-truhlar
Copy link
Collaborator Author

@will-moore Good point re: the ordering of the development instructions - I'll move the copy config file instruction up.
I'm glad it's working for you now.

@allison-truhlar
Copy link
Collaborator Author

Also related: #324

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