Skip to content

Conversation

@pbsds
Copy link
Contributor

@pbsds pbsds commented Jun 4, 2024

black and jinja2 may only be available via VIRTUAL_ENV or PYTHONPATH

pbsds and others added 2 commits June 4, 2024 12:19
@pbsds
Copy link
Contributor Author

pbsds commented Jun 4, 2024

error was:

sqlmodel> =================================== FAILURES ===================================
sqlmodel> _______________________________ test_select_gen ________________________________
sqlmodel> 
sqlmodel>     @needs_py39
sqlmodel>     def test_select_gen() -> None:
sqlmodel> >       result = subprocess.run(
sqlmodel>             [sys.executable, "scripts/generate_select.py"],
sqlmodel>             env={**os.environ, "CHECK_JINJA": "1"},
sqlmodel>             check=True,
sqlmodel>             cwd=root_path,
sqlmodel>             capture_output=True,
sqlmodel>         )
sqlmodel> 
sqlmodel> tests/test_select_gen.py:12: 
sqlmodel> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
sqlmodel> 
sqlmodel> input = None, capture_output = True, timeout = None, check = True
sqlmodel> popenargs = (['/nix/store/7hnr99nxrd2aw6lghybqdmkckq60j6l9-python3-3.11.9/bin/python3.11', 'scripts/generate_select.py'],)
sqlmodel> kwargs = {'cwd': PosixPath('/build/source'), 'env': {'AR': 'ar', 'AS': 'as', 'CC': 'gcc', 'CHECK_JINJA': '1', ...}, 'stderr': -1, 'stdout': -1}
sqlmodel> process = <Popen: returncode: 1 args: ['/nix/store/7hnr99nxrd2aw6lghybqdmkckq60j6l9-py...>
sqlmodel> stdout = b''
sqlmodel> stderr = b'Traceback (most recent call last):\n  File "/build/source/scripts/generate_select.py", line 7, in <module>\n    from jinja2 import Template\nModuleNotFoundError: No module named \'jinja2\'\n'
sqlmodel> retcode = 1
sqlmodel> 

We apply this PR patch in nixpkgs in NixOS/nixpkgs#317160

@tiangolo tiangolo changed the title test_select_gen: passthru environment variables ♻️ Update tests/test_select_gen.py, pass environment variables, needed for NixOS nixpkgs Apr 27, 2025
Copy link
Member

@tiangolo tiangolo left a comment

Choose a reason for hiding this comment

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

Thanks!

Knowing you need it at nixpkgs I get it. 🤓

Thanks! 🚀

@tiangolo tiangolo enabled auto-merge (squash) April 27, 2025 11:29
@tiangolo tiangolo merged commit 2c388a3 into fastapi:main Apr 27, 2025
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants