diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index a3d39f471..b7e93d401 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -7,7 +7,7 @@ on: - master env: - DEFAULT_PYTHON: '3.11' + DEFAULT_PYTHON: '3.12' permissions: contents: read diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 91a50584f..3348b8176 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -14,7 +14,7 @@ concurrency: cancel-in-progress: true env: - DEFAULT_PYTHON: '3.11' + DEFAULT_PYTHON: '3.12' jobs: linters: diff --git a/.github/workflows/data/clickhouse/matrix.yml b/.github/workflows/data/clickhouse/matrix.yml index cf52893ab..6ee63269e 100644 --- a/.github/workflows/data/clickhouse/matrix.yml +++ b/.github/workflows/data/clickhouse/matrix.yml @@ -6,13 +6,13 @@ min: &min max: &max spark-version: 3.5.0 - python-version: '3.11' + python-version: '3.12' java-version: 20 os: ubuntu-latest latest: &latest spark-version: latest - python-version: '3.11' + python-version: '3.12' java-version: 20 os: ubuntu-latest diff --git a/.github/workflows/data/core/matrix.yml b/.github/workflows/data/core/matrix.yml index 78cb7f316..522e2160a 100644 --- a/.github/workflows/data/core/matrix.yml +++ b/.github/workflows/data/core/matrix.yml @@ -6,13 +6,13 @@ min: &min max: &max spark-version: 3.5.0 - python-version: '3.11' + python-version: '3.12' java-version: 20 os: ubuntu-latest latest: &latest spark-version: latest - python-version: '3.11' + python-version: '3.12' java-version: 20 os: ubuntu-latest diff --git a/.github/workflows/data/ftp/matrix.yml b/.github/workflows/data/ftp/matrix.yml index 4a5c92575..58061a5ed 100644 --- a/.github/workflows/data/ftp/matrix.yml +++ b/.github/workflows/data/ftp/matrix.yml @@ -3,7 +3,7 @@ min: &min os: ubuntu-latest max: &max - python-version: '3.11' + python-version: '3.12' os: ubuntu-latest matrix: diff --git a/.github/workflows/data/ftps/matrix.yml b/.github/workflows/data/ftps/matrix.yml index 4497a7371..1ff40b12d 100644 --- a/.github/workflows/data/ftps/matrix.yml +++ b/.github/workflows/data/ftps/matrix.yml @@ -3,7 +3,7 @@ min: &min os: ubuntu-latest max: &max - python-version: '3.11' + python-version: '3.12' os: ubuntu-latest matrix: diff --git a/.github/workflows/data/hdfs/matrix.yml b/.github/workflows/data/hdfs/matrix.yml index eba19818e..465c7eb81 100644 --- a/.github/workflows/data/hdfs/matrix.yml +++ b/.github/workflows/data/hdfs/matrix.yml @@ -8,14 +8,14 @@ min: &min max: &max hadoop-version: hadoop3-hdfs spark-version: 3.5.0 - python-version: '3.11' + python-version: '3.12' java-version: 20 os: ubuntu-latest latest: &latest hadoop-version: hadoop3-hdfs spark-version: latest - python-version: '3.11' + python-version: '3.12' java-version: 20 os: ubuntu-latest diff --git a/.github/workflows/data/hive/matrix.yml b/.github/workflows/data/hive/matrix.yml index 17c1c3a6c..370d22d95 100644 --- a/.github/workflows/data/hive/matrix.yml +++ b/.github/workflows/data/hive/matrix.yml @@ -6,13 +6,13 @@ min: &min max: &max spark-version: 3.5.0 - python-version: '3.11' + python-version: '3.12' java-version: 20 os: ubuntu-latest latest: &latest spark-version: latest - python-version: '3.11' + python-version: '3.12' java-version: 20 os: ubuntu-latest diff --git a/.github/workflows/data/kafka/matrix.yml b/.github/workflows/data/kafka/matrix.yml index 7797d37d6..cf4668e9a 100644 --- a/.github/workflows/data/kafka/matrix.yml +++ b/.github/workflows/data/kafka/matrix.yml @@ -9,14 +9,14 @@ min: &min max: &max kafka-version: 3.5.1 spark-version: 3.5.0 - python-version: '3.11' + python-version: '3.12' java-version: 20 os: ubuntu-latest latest: &latest kafka-version: latest spark-version: latest - python-version: '3.11' + python-version: '3.12' java-version: 20 os: ubuntu-latest diff --git a/.github/workflows/data/local-fs/matrix.yml b/.github/workflows/data/local-fs/matrix.yml index 194150d89..df9bdeffe 100644 --- a/.github/workflows/data/local-fs/matrix.yml +++ b/.github/workflows/data/local-fs/matrix.yml @@ -18,13 +18,13 @@ min_excel: &min_excel max: &max spark-version: 3.5.0 - python-version: '3.11' + python-version: '3.12' java-version: 20 os: ubuntu-latest latest: &latest spark-version: latest - python-version: '3.11' + python-version: '3.12' java-version: 20 os: ubuntu-latest diff --git a/.github/workflows/data/mongodb/matrix.yml b/.github/workflows/data/mongodb/matrix.yml index f91e1baaa..81c02f786 100644 --- a/.github/workflows/data/mongodb/matrix.yml +++ b/.github/workflows/data/mongodb/matrix.yml @@ -7,13 +7,13 @@ min: &min max: &max spark-version: 3.4.1 - python-version: '3.11' + python-version: '3.12' java-version: 20 os: ubuntu-latest latest: &latest spark-version: latest - python-version: '3.11' + python-version: '3.12' java-version: 20 os: ubuntu-latest diff --git a/.github/workflows/data/mssql/matrix.yml b/.github/workflows/data/mssql/matrix.yml index b9941b583..a2c115bc2 100644 --- a/.github/workflows/data/mssql/matrix.yml +++ b/.github/workflows/data/mssql/matrix.yml @@ -6,13 +6,13 @@ min: &min max: &max spark-version: 3.5.0 - python-version: '3.11' + python-version: '3.12' java-version: 20 os: ubuntu-latest latest: &latest spark-version: latest - python-version: '3.11' + python-version: '3.12' java-version: 20 os: ubuntu-latest diff --git a/.github/workflows/data/mysql/matrix.yml b/.github/workflows/data/mysql/matrix.yml index 39ba7034f..435ce9f90 100644 --- a/.github/workflows/data/mysql/matrix.yml +++ b/.github/workflows/data/mysql/matrix.yml @@ -6,13 +6,13 @@ min: &min max: &max spark-version: 3.5.0 - python-version: '3.11' + python-version: '3.12' java-version: 20 os: ubuntu-latest latest: &latest spark-version: latest - python-version: '3.11' + python-version: '3.12' java-version: 20 os: ubuntu-latest diff --git a/.github/workflows/data/oracle/matrix.yml b/.github/workflows/data/oracle/matrix.yml index ca43bed1a..dcf725f51 100644 --- a/.github/workflows/data/oracle/matrix.yml +++ b/.github/workflows/data/oracle/matrix.yml @@ -6,13 +6,13 @@ min: &min max: &max spark-version: 3.5.0 - python-version: '3.11' + python-version: '3.12' java-version: 20 os: ubuntu-latest latest: &latest spark-version: latest - python-version: '3.11' + python-version: '3.12' java-version: 20 os: ubuntu-latest diff --git a/.github/workflows/data/postgres/matrix.yml b/.github/workflows/data/postgres/matrix.yml index c5233c5e8..1f2c6077c 100644 --- a/.github/workflows/data/postgres/matrix.yml +++ b/.github/workflows/data/postgres/matrix.yml @@ -6,13 +6,13 @@ min: &min max: &max spark-version: 3.5.0 - python-version: '3.11' + python-version: '3.12' java-version: 20 os: ubuntu-latest latest: &latest spark-version: latest - python-version: '3.11' + python-version: '3.12' java-version: 20 os: ubuntu-latest diff --git a/.github/workflows/data/s3/matrix.yml b/.github/workflows/data/s3/matrix.yml index 2b6fbdb32..64357c229 100644 --- a/.github/workflows/data/s3/matrix.yml +++ b/.github/workflows/data/s3/matrix.yml @@ -10,14 +10,14 @@ min: &min max: &max minio-version: 2023.7.18 spark-version: 3.5.0 - python-version: '3.11' + python-version: '3.12' java-version: 20 os: ubuntu-latest latest: &latest minio-version: latest spark-version: latest - python-version: '3.11' + python-version: '3.12' java-version: 20 os: ubuntu-latest diff --git a/.github/workflows/data/samba/matrix.yml b/.github/workflows/data/samba/matrix.yml index a4a3afe30..fc1573e02 100644 --- a/.github/workflows/data/samba/matrix.yml +++ b/.github/workflows/data/samba/matrix.yml @@ -3,7 +3,7 @@ min: &min os: ubuntu-latest max: &max - python-version: '3.11' + python-version: '3.12' os: ubuntu-latest matrix: diff --git a/.github/workflows/data/sftp/matrix.yml b/.github/workflows/data/sftp/matrix.yml index 12e2ecd79..44852908b 100644 --- a/.github/workflows/data/sftp/matrix.yml +++ b/.github/workflows/data/sftp/matrix.yml @@ -3,7 +3,7 @@ min: &min os: ubuntu-latest max: &max - python-version: '3.11' + python-version: '3.12' os: ubuntu-latest matrix: diff --git a/.github/workflows/data/teradata/matrix.yml b/.github/workflows/data/teradata/matrix.yml index 05da497c8..5391077c9 100644 --- a/.github/workflows/data/teradata/matrix.yml +++ b/.github/workflows/data/teradata/matrix.yml @@ -1,12 +1,12 @@ max: &max spark-version: 3.5.0 - python-version: '3.11' + python-version: '3.12' java-version: 20 os: ubuntu-latest latest: &latest spark-version: latest - python-version: '3.11' + python-version: '3.12' java-version: 20 os: ubuntu-latest diff --git a/.github/workflows/data/webdav/matrix.yml b/.github/workflows/data/webdav/matrix.yml index 227e7a330..87b492c31 100644 --- a/.github/workflows/data/webdav/matrix.yml +++ b/.github/workflows/data/webdav/matrix.yml @@ -3,7 +3,7 @@ min: &min os: ubuntu-latest max: &max - python-version: '3.11' + python-version: '3.12' os: ubuntu-latest matrix: diff --git a/.github/workflows/dev-release.yml b/.github/workflows/dev-release.yml index 76f362733..1f81fda09 100644 --- a/.github/workflows/dev-release.yml +++ b/.github/workflows/dev-release.yml @@ -9,7 +9,7 @@ on: workflow_dispatch: env: - DEFAULT_PYTHON: '3.11' + DEFAULT_PYTHON: '3.12' concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} diff --git a/.github/workflows/get-matrix.yml b/.github/workflows/get-matrix.yml index 0831a91e9..466ca483a 100644 --- a/.github/workflows/get-matrix.yml +++ b/.github/workflows/get-matrix.yml @@ -47,7 +47,7 @@ on: value: ${{ jobs.get-matrix.outputs.matrix-webdav }} env: - DEFAULT_PYTHON: '3.11' + DEFAULT_PYTHON: '3.12' jobs: get-matrix: diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index da494680e..be5958b1b 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -10,7 +10,7 @@ concurrency: cancel-in-progress: true env: - DEFAULT_PYTHON: '3.11' + DEFAULT_PYTHON: '3.12' jobs: get-matrix: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e0d227ea9..e8398a28e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,7 +6,7 @@ on: - '[0-9]+.[0-9]+.[0-9]+' env: - DEFAULT_PYTHON: '3.11' + DEFAULT_PYTHON: '3.12' jobs: release: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 95cc9ade8..eadb07917 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,7 +13,7 @@ concurrency: cancel-in-progress: true env: - DEFAULT_PYTHON: '3.11' + DEFAULT_PYTHON: '3.12' jobs: get-matrix: diff --git a/.readthedocs.yml b/.readthedocs.yml index 923741b22..13358b8b3 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -3,7 +3,7 @@ version: 2 build: os: ubuntu-22.04 tools: - python: "3.11" + python: "3.12" python: install: diff --git a/README.rst b/README.rst index 792eb1dc4..603eef364 100644 --- a/README.rst +++ b/README.rst @@ -51,7 +51,7 @@ Non-goals Requirements ------------ -* **Python 3.7 - 3.11** +* **Python 3.7 - 3.12** * PySpark 2.3.x - 3.5.x (depends on used connector) * Java 8+ (required by Spark, see below) * Kerberos libs & GCC (required by ``Hive``, ``HDFS`` and ``SparkHDFS`` connectors) @@ -177,9 +177,9 @@ Compatibility matrix +--------------------------------------------------------------+-------------+-------------+-------+ | `3.3.x `_ | 3.7 - 3.10 | 8u201 - 17 | 2.12 | +--------------------------------------------------------------+-------------+-------------+-------+ -| `3.4.x `_ | 3.7 - 3.11 | 8u362 - 20 | 2.12 | +| `3.4.x `_ | 3.7 - 3.12 | 8u362 - 20 | 2.12 | +--------------------------------------------------------------+-------------+-------------+-------+ -| `3.5.x `_ | 3.8 - 3.11 | 8u371 - 20 | 2.12 | +| `3.5.x `_ | 3.8 - 3.12 | 8u371 - 20 | 2.12 | +--------------------------------------------------------------+-------------+-------------+-------+ .. _pyspark-install: diff --git a/docs/changelog/next_release/167.feature.rst b/docs/changelog/next_release/167.feature.rst new file mode 100644 index 000000000..5a1b9dd31 --- /dev/null +++ b/docs/changelog/next_release/167.feature.rst @@ -0,0 +1 @@ +Add Python 3.12 compatibility. diff --git a/onetl/impl/local_path.py b/onetl/impl/local_path.py index 443b2920d..9708fc200 100644 --- a/onetl/impl/local_path.py +++ b/onetl/impl/local_path.py @@ -13,6 +13,7 @@ # limitations under the License. import os +import sys from pathlib import Path, PurePosixPath, PureWindowsPath @@ -20,8 +21,10 @@ class LocalPath(Path): def __new__(cls, *args, **kwargs): if cls is LocalPath: cls = LocalWindowsPath if os.name == "nt" else LocalPosixPath - self = cls._from_parts(args) - return self # noqa: WPS331 + if sys.version_info < (3, 12): + return cls._from_parts(args) + else: + return object.__new__(cls) # noqa: WPS503 class LocalPosixPath(LocalPath, PurePosixPath): diff --git a/setup.py b/setup.py index f8b560707..6cff75434 100644 --- a/setup.py +++ b/setup.py @@ -70,6 +70,7 @@ def parse_requirements(file: Path) -> list[str]: "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries :: Java Libraries", "Topic :: Software Development :: Libraries :: Python Modules",