diff options
author | Federico Caselli <CaselIT@users.noreply.github.com> | 2021-11-12 19:15:14 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-12 19:15:14 +0100 |
commit | fa7dd33228ba5f85339e5439f4d05d5d53124475 (patch) | |
tree | f2c777899b5a01332d5a82b515ff6b607dc0e8bd | |
parent | 8c4c3ce95768aca0a1e5b1b6c0d92da02b94b178 (diff) | |
download | python-mimeparse-fa7dd33228ba5f85339e5439f4d05d5d53124475.tar.gz |
* Add github actions
Fixes: #39
* Fix workflow
* Move setup information to setup.cfg
* Use pep517 to build
* chore: review feedback
Co-authored-by: Vytautas Liuolia <vytautas.liuolia@gmail.com>
-rw-r--r-- | .github/workflows/run-test.yaml | 1 | ||||
-rw-r--r-- | MANIFEST.in | 2 | ||||
-rw-r--r-- | pyproject.toml | 6 | ||||
-rw-r--r-- | setup.cfg | 42 | ||||
-rwxr-xr-x | setup.py | 61 |
5 files changed, 49 insertions, 63 deletions
diff --git a/.github/workflows/run-test.yaml b/.github/workflows/run-test.yaml index 519a444..884200a 100644 --- a/.github/workflows/run-test.yaml +++ b/.github/workflows/run-test.yaml @@ -12,6 +12,7 @@ jobs: strategy: matrix: python-version: + - "3.5" - "3.6" - "3.7" - "3.8" diff --git a/MANIFEST.in b/MANIFEST.in index d071265..3bdb9ab 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1 +1 @@ -include README.rst LICENSE mimeparse_test.py testdata.json +include README.rst LICENSE mimeparse_test.py testdata.json pyproject.toml diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..c4ef621 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,6 @@ +[build-system] + build-backend = "setuptools.build_meta" + requires = [ + "setuptools>=47", + "wheel>=0.34", + ] @@ -1,2 +1,40 @@ -[bdist_wheel] -universal = 1 +[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.6 + Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3.8 + Programming Language :: Python :: 3.9 + Programming Language :: Python :: 3.10 + 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.5 +py_modules = mimeparse +install_requires = +tests_require = + pytest @@ -1,62 +1,3 @@ -#!/usr/bin/env python - -import codecs -import os -import re - from setuptools import setup - -def get_version(filename): - """ - Return package version as listed in `__version__` in 'filename'. - """ - with open(filename) as fp: - contents = fp.read() - return re.search("__version__ = ['\"]([^'\"]+)['\"]", contents).group(1) - - -version = get_version('mimeparse.py') -if not version: - raise RuntimeError('Cannot find version information') - - -def read(fname): - path = os.path.join(os.path.dirname(__file__), fname) - with codecs.open(path, encoding='utf-8') as fp: - return fp.read() - - -setup( - name="python-mimeparse", - py_modules=["mimeparse"], - version=version, - description=("A module provides basic functions for parsing mime-type " - "names and matching them against a list of media-ranges."), - author="DB Tsai", - license="MIT", - author_email="dbtsai@dbtsai.com", - url="https://github.com/dbtsai/python-mimeparse", - download_url=("https://github.com/dbtsai/python-mimeparse/tarball/" + version), - keywords=["mime-type"], - python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*', - classifiers=[ - "Programming Language :: Python", - "Programming Language :: Python :: 2", - "Programming Language :: Python :: 2.7", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.4", - "Programming Language :: Python :: 3.5", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "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", - ], - long_description=read('README.rst') -) +setup() |