From 54f94ddbe9d0e62b5187c27b36ed04b873a0bc8e Mon Sep 17 00:00:00 2001 From: Vytautas Liuolia Date: Fri, 23 Aug 2024 12:33:25 +0200 Subject: [PATCH 1/4] chore: modernize setup even more (leave only `pyproject.toml`) --- mimeparse.py | 2 +- pyproject.toml | 57 +++++++++++++++++++++++++++++++++++++++++++++----- setup.cfg | 41 ------------------------------------ setup.py | 3 --- 4 files changed, 53 insertions(+), 50 deletions(-) delete mode 100644 setup.cfg delete mode 100755 setup.py diff --git a/mimeparse.py b/mimeparse.py index 14b567c..84f069d 100644 --- a/mimeparse.py +++ b/mimeparse.py @@ -1,4 +1,4 @@ -__version__ = '1.6.0' +__version__ = '2.0.0a1' __author__ = 'Joe Gregorio' __email__ = 'joe@bitworking.org' __license__ = 'MIT License' diff --git a/pyproject.toml b/pyproject.toml index c4ef621..4453f96 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,53 @@ [build-system] - build-backend = "setuptools.build_meta" - requires = [ - "setuptools>=47", - "wheel>=0.34", - ] +build-backend = "setuptools.build_meta" +requires = [ + "setuptools>=47", + "wheel>=0.34", +] + +[project] +name = "python-mimeparse" +readme = "README.rst" +dynamic = ["version"] +dependencies = [] +requires-python = ">=3.8" +description = "A module provides basic functions for parsing mime-type names and matching them against a list of media-ranges." +license = {text = "MIT"} +authors = [ + {name = "DB Tsai", email = "dbtsai@dbtsai.com"}, +] +maintainers = [ + {name = "Falconry team", email = "mail@kgriffs.com"}, +] +classifiers = [ + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: Implementation :: CPython", + "Programming Language :: Python :: Implementation :: PyPy", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + "Development Status :: 6 - Mature", + "Intended Audience :: Developers", + "Topic :: Internet :: WWW/HTTP", + "Topic :: Software Development :: Libraries :: Python Modules", +] +keywords = ["mime-type", "media-type"] + +[project.urls] +Homepage = "https://github.com/falconry/python-mimeparse" +"Issue Tracker" = "https://github.com/falconry/python-mimeparse/issues" +Funding = "https://opencollective.com/falcon" +Chat = "https://gitter.im/falconry/user" + +[tool.setuptools] +license-files = ["LICENSE"] +py-modules = ["mimeparse"] + +[tool.setuptools.dynamic] +version = {attr = "mimeparse.__version__"} diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 5973b76..0000000 --- a/setup.cfg +++ /dev/null @@ -1,41 +0,0 @@ -[metadata] -name = python-mimeparse -version = attr: mimeparse.__version__ -description = A module provides basic functions for parsing mime-type names and matching them against a list of media-ranges. -long_description = file: README.rst -long_description_content_type = text/x-rst -url = https://github.com/falconry/python-mimeparse -author = DB Tsai -author_email = dbtsai@dbtsai.com -maintainer = Falcon team -maintainer_email = mail@kgriffs.com -license = MIT -license_file = LICENSE -classifiers = - Programming Language :: Python - Programming Language :: Python :: 3 - Programming Language :: Python :: 3.7 - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 - Programming Language :: Python :: 3.10 - Programming Language :: Python :: 3.11 - Programming Language :: Python :: 3.12 - Programming Language :: Python :: Implementation :: CPython - Programming Language :: Python :: Implementation :: PyPy - License :: OSI Approved :: MIT License - Operating System :: OS Independent - Development Status :: 5 - Production/Stable - Intended Audience :: Developers - Topic :: Internet :: WWW/HTTP - Topic :: Software Development :: Libraries :: Python Modules -keywords = - mime-type -project_urls = - Issue Tracker=https://github.com/falconry/python-mimeparse - -[options] -python_requires = >=3.7 -py_modules = mimeparse -install_requires = -tests_require = - pytest diff --git a/setup.py b/setup.py deleted file mode 100755 index 6068493..0000000 --- a/setup.py +++ /dev/null @@ -1,3 +0,0 @@ -from setuptools import setup - -setup() From a4416f44e1114061c476ac612ba1a24d84de37dc Mon Sep 17 00:00:00 2001 From: Vytautas Liuolia Date: Fri, 23 Aug 2024 12:40:46 +0200 Subject: [PATCH 2/4] chore(CI): clean up Actions workflows --- .github/workflows/run-test.yaml | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/.github/workflows/run-test.yaml b/.github/workflows/run-test.yaml index 07c081b..e2c3253 100644 --- a/.github/workflows/run-test.yaml +++ b/.github/workflows/run-test.yaml @@ -4,21 +4,19 @@ on: push: pull_request: - jobs: - run-test: + run-tox: name: test-${{ matrix.python-version }} runs-on: "ubuntu-latest" strategy: matrix: python-version: - - "3.7" - "3.8" - "3.9" - "3.10" - "3.11" - "3.12" - - "pypy-3.7" + - "3.13.0-rc.1 - 3.13" - "pypy-3.8" - "pypy-3.9" - "pypy-3.10" @@ -27,49 +25,45 @@ jobs: steps: - name: Checkout repo - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - architecture: ${{ matrix.architecture }} - name: Install dependencies run: | - python -m pip install --upgrade pip - pip install --upgrade tox setuptools - pip list + pip install --upgrade pip + pip install --upgrade tox - name: Run tests run: | tox -e py - + run-lint: name: lint runs-on: "ubuntu-latest" strategy: matrix: python-version: - - "3.10" + - "3.12" fail-fast: false steps: - name: Checkout repo - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - architecture: ${{ matrix.architecture }} - name: Install dependencies run: | - python -m pip install --upgrade pip - pip install --upgrade tox setuptools - pip list + pip install --upgrade pip + pip install --upgrade tox - name: Run lint run: | From b9c528a875d07e73113ce2ec6406d4339a8b03f3 Mon Sep 17 00:00:00 2001 From: Vytautas Liuolia Date: Fri, 23 Aug 2024 12:46:42 +0200 Subject: [PATCH 3/4] docs: bump info on required Py version --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 4adaa2a..b3f5c90 100644 --- a/README.rst +++ b/README.rst @@ -15,7 +15,7 @@ Use **pip**: $ pip install python-mimeparse -It supports Python 3.7+ and PyPy. +It supports Python 3.8+ and PyPy. Functions --------- From f3e5f13e32b9293b48fb2fec504af054882a0428 Mon Sep 17 00:00:00 2001 From: Vytautas Liuolia Date: Fri, 23 Aug 2024 12:52:34 +0200 Subject: [PATCH 4/4] chore: specify test deps --- pyproject.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 4453f96..0d0e0e2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,6 +39,9 @@ classifiers = [ ] keywords = ["mime-type", "media-type"] +[project.optional-dependencies] +test = ["pytest"] + [project.urls] Homepage = "https://github.com/falconry/python-mimeparse" "Issue Tracker" = "https://github.com/falconry/python-mimeparse/issues"