setuptools icon indicating copy to clipboard operation
setuptools copied to clipboard

[FR] Update platformdirs to 4.2.2

Open youknowone opened this issue 1 year ago • 4 comments

What's the problem this feature will solve?

Current version of setuptools requires ctypes to run on windows.

Describe the solution you'd like

The hard dependency of ctypes came from platformdirs. Since platformdirs released a new version including the required change, upgrading platformdirs to 4.2.2 will fix the issue.

Alternative Solutions

No response

Additional context

Hi, I am a developer of RustPython, which does not support ctypes yet. This fix will allow RustPython to access most of packages packaged with setuptools on PyPI.

Code of Conduct

  • [X] I agree to follow the PSF Code of Conduct

youknowone avatar Jul 08 '24 07:07 youknowone

@youknowone as of 71.0.0

setuptools will prefer installed dependencies if present

I think this offers a path by installing / pre-installing platformdirs>=4.2.2 before setuptools>=71 (although I agree it would be nicer if your users didn't have to).

Avasam avatar Jul 30 '24 23:07 Avasam

Thank you so much! I didn't think of that since it was vendored.

youknowone avatar Jul 31 '24 03:07 youknowone

Looks like https://github.com/pypa/setuptools/commit/4f6d97344c9e15c643aa3e366b21377a2008bc11#diff-6f6b1498bf597f61de49548bf7618ef15201dd95f0cf9fffa36e357dc802353bR15-R16 also updated the vendored version of platformdirs to 4.2.2

So if it's not already installed, it should work fine, and if it's pre-installed, the current requirement of platformdirs >= 2.6.2 should match 4.2.2 when upgrading.

So if pip install setuptools[core] --upgrade doesn't work, running pip install platformdirs>=4.2.2 first ought to work.

@jaraco Do you think it's worth bumping the declared platformdirs dependency for this ? To help platforms lacking ctypes support install setuptools seamlessly ?

Avasam avatar Aug 11 '24 17:08 Avasam

Do you think it's worth bumping the declared platformdirs dependency for this ? To help platforms lacking ctypes support install setuptools seamlessly ?

I'd be fine with that.

jaraco avatar Aug 12 '24 15:08 jaraco