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

Add Python 3.12 support (#36755) #38025

Merged
merged 1 commit into from Mar 12, 2024
Merged

Add Python 3.12 support (#36755) #38025

merged 1 commit into from Mar 12, 2024

Conversation

potiuk
Copy link
Member

@potiuk potiuk commented Mar 11, 2024

Finally after a number of dependency upgrades we seem to be able to upgrade to Python 3.12 (pending universal_pathlib 0.2.0 conversion)

Several providers are excluded from being installed and wait for Python 3.12, but it should not block Airlfow's general 3.12 support.

Co-authored-by: dirrao dirisala.gopal@gmail.com
(cherry picked from commit 76dee0b)


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

@potiuk potiuk added canary When set on PR running from apache repo - behave as canary run latest versions only Only latest versions of Python and K8S are used for tests labels Mar 11, 2024
Copy link
Collaborator

@dirrao dirrao left a comment

Choose a reason for hiding this comment

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

Awesome. I am eagerly waiting for the initial release. Thank you for the amazing work @potiuk.

@Taragolis
Copy link
Contributor

Oh.. we need conditional for Pendulum2 tests since pendulum 2 not supported in Python 3.12 due to removed parts

@potiuk
Copy link
Member Author

potiuk commented Mar 11, 2024

Oh.. we need conditional for Pendulum2 tests since pendulum 2 not supported in Python 3.12 due to removed parts

Good point. We also need to have it in release notes.

@potiuk
Copy link
Member Author

potiuk commented Mar 11, 2024

Oh.. we need conditional for Pendulum2 tests since pendulum 2 not supported in Python 3.12 due to removed parts

Good point. We also need to have it in release notes.

Added both

@potiuk potiuk force-pushed the python-3-12-revised branch 3 times, most recently from a975a5d to e5d6a37 Compare March 11, 2024 14:33
@potiuk potiuk added the disable image cache Disables cache when buidling CI images label Mar 11, 2024
@Taragolis
Copy link
Contributor

Taragolis commented Mar 11, 2024

Ahh this one is regression of #38027 in case of Python 3.12 🤕 , seems like botocore/boto3 internally use deprecated in stuff 🙄

      def add_auth(self, request):
          if self.credentials is None:
              raise NoCredentialsError()
  >       datetime_now = datetime.datetime.utcnow()
  E       DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: 

@potiuk
Copy link
Member Author

potiuk commented Mar 11, 2024

Ahh this one is regression of #38027 in case of Python 3.12 🤕 , seems like botocore/boto3 internally use deprecated in stuff

Yeah . Was just looking at it . What's the best fix ?

@Taragolis
Copy link
Contributor

You could cherry pick #38043, locally it works fine in python 3.12.

@potiuk
Copy link
Member Author

potiuk commented Mar 11, 2024

I just pushd my version :) . Almost the same

            if sys.version_info >= (3, 12):
                # Botocore generates deprecation warning on Python 3.12 connected with utcnow use
                warnings.filterwarnings("ignore", message=r".*datetime.utcnow.*", category=DeprecationWarning)

@potiuk potiuk removed the latest versions only Only latest versions of Python and K8S are used for tests label Mar 11, 2024
@potiuk
Copy link
Member Author

potiuk commented Mar 11, 2024

OK. It seems to be quite good. I removed the "latest version only" and pushed a PR that should do the same things that the canary build will do eventually. It's ready for review in general.

🤞

I had to add a few more exclusions to make sure that we are skipping some of the imports in some of the "common" tests - when some providers are excluded - because eventually the 3.12 image will be missing some librarires and those imports will fail . I think I covered all cases and that the timeouts we saw last time were caused by these problems and by the impersonation test which is now quarantined.

Again 🤞

@potiuk
Copy link
Member Author

potiuk commented Mar 11, 2024

BTW. I also added here few controls in our CI (labels) that allow to iterate on such PRs with far less resources used and faster :)

@potiuk
Copy link
Member Author

potiuk commented Mar 11, 2024

Also I have found why we had the difference in tests failing for cassandra after I merged last PR - main reason was because cassandra was not yet excluded in main - so I will need to merge #38050 first and only after it will be merged, I will have to (again) rebase this PR after increasing the EPOCH.

@potiuk potiuk force-pushed the python-3-12-revised branch 3 times, most recently from f82faee to 2a65012 Compare March 11, 2024 21:53
Finally after a number of dependency upgrades we seem to be able to
upgrade to Python 3.12 (pending universal_pathlib 0.2.0 conversion)

Several providers are excluded from being installed and wait for
Python 3.12, but it should not block Airlfow's general 3.12 support.

Co-authored-by: dirrao <dirisala.gopal@gmail.com>
(cherry picked from commit 76dee0b)
@potiuk potiuk merged commit 7213fc5 into main Mar 12, 2024
92 of 95 checks passed
@potiuk potiuk deleted the python-3-12-revised branch March 12, 2024 00:24
drajguru pushed a commit to drajguru/airflow that referenced this pull request Mar 14, 2024
Finally after a number of dependency upgrades we seem to be able to
upgrade to Python 3.12 (pending universal_pathlib 0.2.0 conversion)

Several providers are excluded from being installed and wait for
Python 3.12, but it should not block Airlfow's general 3.12 support.

Co-authored-by: dirrao <dirisala.gopal@gmail.com>
(cherry picked from commit 76dee0b)
@ephraimbuddy ephraimbuddy added the type:misc/internal Changelog: Misc changes that should appear in change log label Mar 14, 2024
@eladkal eladkal mentioned this pull request Mar 15, 2024
2 tasks
howardyoo pushed a commit to howardyoo/airflow that referenced this pull request Mar 18, 2024
Finally after a number of dependency upgrades we seem to be able to
upgrade to Python 3.12 (pending universal_pathlib 0.2.0 conversion)

Several providers are excluded from being installed and wait for
Python 3.12, but it should not block Airlfow's general 3.12 support.

Co-authored-by: dirrao <dirisala.gopal@gmail.com>
(cherry picked from commit 76dee0b)
howardyoo pushed a commit to howardyoo/airflow that referenced this pull request Mar 31, 2024
Finally after a number of dependency upgrades we seem to be able to
upgrade to Python 3.12 (pending universal_pathlib 0.2.0 conversion)

Several providers are excluded from being installed and wait for
Python 3.12, but it should not block Airlfow's general 3.12 support.

Co-authored-by: dirrao <dirisala.gopal@gmail.com>
(cherry picked from commit 76dee0b)
utkarsharma2 pushed a commit to astronomer/airflow that referenced this pull request Apr 22, 2024
Finally after a number of dependency upgrades we seem to be able to
upgrade to Python 3.12 (pending universal_pathlib 0.2.0 conversion)

Several providers are excluded from being installed and wait for
Python 3.12, but it should not block Airlfow's general 3.12 support.

Co-authored-by: dirrao <dirisala.gopal@gmail.com>
(cherry picked from commit 76dee0b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:dev-tools area:production-image Production image improvements and fixes area:providers canary When set on PR running from apache repo - behave as canary run disable image cache Disables cache when buidling CI images provider:apache-cassandra type:misc/internal Changelog: Misc changes that should appear in change log
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants