You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "SuccessMoses (via GitHub)" <gi...@apache.org> on 2024/11/16 13:23:20 UTC

[PR] BUG Update `initialise_virtualenv.py` to use `uv sync` [airflow]

SuccessMoses opened a new pull request, #44096:
URL: https://github.com/apache/airflow/pull/44096

   <!--
    Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
    distributed with this work for additional information
    regarding copyright ownership.  The ASF licenses this file
    to you under the Apache License, Version 2.0 (the
    "License"); you may not use this file except in compliance
    with the License.  You may obtain a copy of the License at
   
      http://www.apache.org/licenses/LICENSE-2.0
   
    Unless required by applicable law or agreed to in writing,
    software distributed under the License is distributed on an
    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, either express or implied.  See the License for the
    specific language governing permissions and limitations
    under the License.
    -->
   
   <!--
   Thank you for contributing! Please make sure that your code changes
   are covered with tests. And in case of new features or big changes
   remember to adjust the documentation.
   
   Feel free to ping committers for the review!
   
   In case of an existing issue, reference it using one of the following:
   
   closes: #ISSUE
   related: #ISSUE
   
   How to write a good git commit message:
   http://chris.beams.io/posts/git-commit/
   -->
   closes: #44078
   
   `uv` is the recommended tool for installing `airflow` and other dependecies. I updated the `./scripts/tool/initialise_virtualenv.py` file to use `uv sync` instead of `pip unstall`
   
   
   
   <!-- Please keep an empty line above the dashes. -->


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] BUG Update `initialise_virtualenv.py` to use `uv sync` [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on PR #44096:
URL: https://github.com/apache/airflow/pull/44096#issuecomment-2480662916

   If we use `uv` to create venv. You should either activate it with sourcing `./venv/bin/activate`first  or using `uv run` to run the command in the venv you just created (the venv is created in projects's root `.venv` sub-folder.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] BUG Update `initialise_virtualenv.py` to use `uv sync` [airflow]

Posted by "SuccessMoses (via GitHub)" <gi...@apache.org>.
SuccessMoses commented on PR #44096:
URL: https://github.com/apache/airflow/pull/44096#issuecomment-2480968142

   Should I add `aiosqlite` to dependencies in `./pyproject.toml`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] BUG Update `initialise_virtualenv.py` to use `uv sync` [airflow]

Posted by "SuccessMoses (via GitHub)" <gi...@apache.org>.
SuccessMoses commented on PR #44096:
URL: https://github.com/apache/airflow/pull/44096#issuecomment-2480578046

   even with this changes there is still a bug:
   ```
   airflow version
   ```
   Observation:
   ```
   airflow) success@success-HP-Laptop-14-cf3xxx:~/Desktop/airflow$ airflow version
   Traceback (most recent call last):
     File "/home/success/Desktop/airflow/.venv/bin/airflow", line 5, in <module>
       from airflow.__main__ import main
     File "/home/success/Desktop/airflow/airflow/__init__.py", line 78, in <module>
       settings.initialize()
     File "/home/success/Desktop/airflow/airflow/settings.py", line 787, in initialize
       configure_orm()
     File "/home/success/Desktop/airflow/airflow/settings.py", line 494, in configure_orm
       async_engine = create_async_engine(SQL_ALCHEMY_CONN_ASYNC, future=True)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File "/home/success/Desktop/airflow/.venv/lib/python3.12/site-packages/sqlalchemy/ext/asyncio/engine.py", line 43, in create_async_engine
       sync_engine = _create_engine(*arg, **kw)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^
     File "<string>", line 2, in create_engine
     File "/home/success/Desktop/airflow/.venv/lib/python3.12/site-packages/sqlalchemy/util/deprecations.py", line 375, in warned
       return fn(*args, **kwargs)
              ^^^^^^^^^^^^^^^^^^^
     File "/home/success/Desktop/airflow/.venv/lib/python3.12/site-packages/sqlalchemy/engine/create.py", line 544, in create_engine
       dbapi = dialect_cls.dbapi(**dbapi_args)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File "/home/success/Desktop/airflow/.venv/lib/python3.12/site-packages/sqlalchemy/dialects/sqlite/aiosqlite.py", line 321, in dbapi
       __import__("aiosqlite"), __import__("sqlite3")
   ```
   ## Hypothesis:
   No modules named `aiosqlite` and `sqlite3`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] BUG Update `initialise_virtualenv.py` to use `uv sync` [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk merged PR #44096:
URL: https://github.com/apache/airflow/pull/44096


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] BUG Update `initialise_virtualenv.py` to use `uv sync` [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on PR #44096:
URL: https://github.com/apache/airflow/pull/44096#issuecomment-2481062074

   No - it's already added by "hatch_build.py"  via sqlite dependency. What you needed to do (see the fixup I added) - is to run the airflow commands via "uv run" command.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org