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

distutils has been deprecated in Python 3.10 #232

Closed
tirkarthi opened this issue Dec 29, 2021 · 3 comments · Fixed by #238
Closed

distutils has been deprecated in Python 3.10 #232

tirkarthi opened this issue Dec 29, 2021 · 3 comments · Fixed by #238

Comments

@tirkarthi
Copy link

https://www.python.org/dev/peps/pep-0632/#migration-advice

from distutils.util import convert_path

Probably this code snippet could be vendored

https://github.com/python/cpython/blob/f4c03484da59049eb62a9bf7777b963e2267d187/Lib/distutils/util.py#L110

@pcraciunoiu
Copy link
Contributor

@tirkarthi if you'd like to submit a PR with details and a proposed fix, I can review it.

@mlissner
Copy link
Contributor

I briefly studied the setup.py file. I could be off base, but my impression is that there's a fair bit of boiler plate in there that could be reduced or removed by moving to more modern packaging.

For the packages my organization maintains, we usually use poetry, which does away with the setup.py and requirements.txt files and replaces them with a pyproject.toml file that holds all the needed metadata for the package.

I know I'm pushing for another big swap in #182, so maybe I'm becoming a bit of a gadfly, but if you'd welcome a switch to poetry, I think I'd be able to put together a PR for it and I think it'd be a nice leap forward for the project.

For example, building and uploading a package to pypi is much simpler. It's just:

poetry publish --build

This Github Action would do it on any commit tagged with v*..:

name: PyPI
on:
  push:
    tags:
      - v*.*.*
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Install Poetry
        uses: snok/install-poetry@v1.1.0
        with:
          virtualenvs-create: true
          virtualenvs-in-project: true
      - name: Publish to pypi
        run: poetry publish --build
        env:
          POETRY_PYPI_TOKEN_PYPI: "${{ secrets.pypi_token }}"

@pcraciunoiu
Copy link
Contributor

@mlissner that sounds good to me. I've used poetry before and just haven't put in the time to switch this project. If you would do that, that'd be great. And nice to have publishing to pypi via CI too.

pcraciunoiu pushed a commit that referenced this issue Mar 22, 2022
* Switch to poetry from pip

A few notes:

1. I did my best to carry over everything from setup.py and other files.

1. This removes the AUHORS file, and migrates it to the `authors` key
   in pyproject.toml. Similarly, it removes authors from the readme,
   and the __init__.py so there's one source of truth.

1. This removes the MANIFEST.in file, and migrats it to the include
   parameter of in pyproject.toml.

1. This adds a new, small dependency to allow the __version__ attribute
   to work in __init__.py. It's only needed in Python <= 3.7, so it's
   marked accordingly.

1.

* Remove deprecated versions of Python and Django

* Add CI for auto-pushes to pypi and update readme accordingly

* fix(tests): Make tox work again

* Respond to feed back in PR: #238
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants