Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit aa9ec21

Browse files
committed
ARROW-12068: [Python] Stop using distutils
According to PEP 632, distutils will be deprecated in Python 3.10 and removed in 3.12. * switch to `setuptools` for general packaging * use the `Version` class from the `packaging` project instead of `distutils.LooseVersion` Closes apache#9849 from pitrou/ARROW-12068-remove-distutils Authored-by: Antoine Pitrou <[email protected]> Signed-off-by: Antoine Pitrou <[email protected]>
1 parent 59bb69b commit aa9ec21

4 files changed

Lines changed: 14 additions & 3 deletions

File tree

LICENSE.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2209,3 +2209,12 @@ The files in cpp/src/arrow/vendored/fast_float/ contain code from
22092209
https://github.com/lemire/fast_float
22102210

22112211
which is made available under the Apache License 2.0.
2212+
2213+
--------------------------------------------------------------------------------
2214+
2215+
The file python/pyarrow/vendored/version.py contains code from
2216+
2217+
https://github.com/pypa/packaging/
2218+
2219+
which is made available under both the Apache license v2.0 and the
2220+
BSD 2-clause license.

dev/release/rat_exclude_files.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ python/MANIFEST.in
136136
python/manylinux1/.dockerignore
137137
python/pyarrow/includes/__init__.pxd
138138
python/pyarrow/tests/__init__.py
139+
python/pyarrow/vendored/*
139140
python/requirements*.txt
140141
pax_global_header
141142
MANIFEST.in

dev/tasks/conda-recipes/azure.clean.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
displayName: Clone arrow
1414
1515
- script: |
16-
conda install -y -c conda-forge pandas anaconda-client
16+
conda install -y -c conda-forge pandas anaconda-client packaging
1717
displayName: Install requirements
1818
1919
- script: |

dev/tasks/conda-recipes/clean.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from distutils.version import LooseVersion
21
from subprocess import check_output, check_call
32
from typing import List
43

@@ -7,6 +6,8 @@
76
import pandas as pd
87
import sys
98

9+
from packaging.version import Version
10+
1011

1112
VERSIONS_TO_KEEP = 5
1213
PACKAGES = [
@@ -44,7 +45,7 @@ def packages_to_delete(package_name: str, platform: str) -> List[str]:
4445
env=env,
4546
)
4647
pkgs = pd.DataFrame(json.loads(pkgs_json)[package_name])
47-
pkgs["version"] = pkgs["version"].map(LooseVersion)
48+
pkgs["version"] = pkgs["version"].map(Version)
4849
pkgs["py_version"] = pkgs["build"].str.slice(0, 4)
4950

5051
to_delete = []

0 commit comments

Comments
 (0)