-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #117 from supermihi/modernize-tooling
Modernize tooling
- Loading branch information
Showing
7 changed files
with
54 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
include src/*.pxd | ||
include src/*.pyx | ||
include src/*.pyx | ||
include tests/data/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,43 @@ | ||
[build-system] | ||
requires = ["setuptools", "wheel", "cython"] | ||
requires = ["setuptools", "cython==3.0.*"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
name = "pytaglib" | ||
version = "2.0.0" | ||
requires-python = ">=3.6" | ||
description = "cross-platform, Python audio metadata (\"tagging\") library based on TagLib" | ||
authors = [ | ||
{ name = "Michael Helmling", email = "[email protected]" } | ||
] | ||
readme = "Readme.md" | ||
license = { text = "GPLv3+" } | ||
classifiers = [ | ||
"Development Status :: 5 - Production/Stable", | ||
"Intended Audience :: Developers", | ||
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", | ||
"Natural Language :: English", | ||
"Operating System :: OS Independent", | ||
"Programming Language :: Cython", | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 3", | ||
"Topic :: Software Development :: Libraries :: Python Modules", ] | ||
|
||
[project.urls] | ||
Repository = "https://github.com/supermihi/pytaglib" | ||
Issues = "https://github.com/supermihi/pytaglib/issues" | ||
Changelog = "https://github.com/supermihi/pytaglib/blob/main/CHANGELOG.md" | ||
|
||
[project.optional-dependencies] | ||
tests = ["pytest~=7.4.3"] | ||
|
||
[project.scripts] | ||
pyprinttags = "pyprinttags:script" | ||
|
||
[tool.setuptools] | ||
package-dir = { "" = "src" } | ||
|
||
[tool.cibuildwheel] | ||
test-requires = "pytest" | ||
test-extras = ["tests"] | ||
test-command = "pytest {project}/tests" | ||
before-build = "python build_taglib.py --clean" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,44 +6,25 @@ | |
# it under the terms of the GNU General Public License version 3 as | ||
# published by the Free Software Foundation | ||
# | ||
"""Setup file for pytaglib. Type <python setup.py install> to install this package.""" | ||
|
||
import os | ||
import platform | ||
import re | ||
import sys | ||
from pathlib import Path | ||
|
||
from Cython.Build import cythonize | ||
from setuptools import setup, Extension | ||
|
||
is_x64 = sys.maxsize > 2**32 | ||
is_x64 = sys.maxsize > 2 ** 32 | ||
arch = "x64" if is_x64 else "x32" | ||
system = platform.system() | ||
python_version = platform.python_version() | ||
here = Path(__file__).resolve().parent | ||
default_taglib_path = here / "build" / "taglib" / f"{system}-{arch}-py{python_version}" | ||
|
||
CLASSIFIERS = [ | ||
"Development Status :: 5 - Production/Stable", | ||
"Intended Audience :: Developers", | ||
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", | ||
"Natural Language :: English", | ||
"Operating System :: OS Independent", | ||
"Programming Language :: Cython", | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 3", | ||
"Topic :: Software Development :: Libraries :: Python Modules", | ||
] | ||
|
||
src = Path("src") | ||
|
||
|
||
def readme(): | ||
readme_file = here / "README.md" | ||
return readme_file.read_text("utf-8") | ||
|
||
|
||
def extension_kwargs(): | ||
taglib_install_dir = Path(os.environ.get("TAGLIB_HOME", str(default_taglib_path))) | ||
if sys.platform.startswith("win"): | ||
|
@@ -69,34 +50,9 @@ def extension_kwargs(): | |
) | ||
|
||
|
||
def version(): | ||
taglib_pyx = here / src / "taglib.pyx" | ||
version_match = re.search( | ||
r"^version = ['\"]([^'\"]*)['\"]", taglib_pyx.read_text(), re.M | ||
) | ||
return version_match.group(1) | ||
|
||
|
||
setup( | ||
name="pytaglib", | ||
description='cross-platform, Python audio metadata ("tagging") library based on TagLib', | ||
long_description=readme(), | ||
long_description_content_type="text/markdown", | ||
classifiers=CLASSIFIERS, | ||
version=version(), | ||
license="GPLv3+", | ||
author="Michael Helmling", | ||
author_email="[email protected]", | ||
url="http://github.com/supermihi/pytaglib", | ||
ext_modules=cythonize( | ||
[Extension("taglib", [str(src / "taglib.pyx")], **extension_kwargs())], | ||
force=True, | ||
), | ||
package_dir={"": "src"}, | ||
py_modules=["pytaglib", "pyprinttags"], | ||
entry_points={"console_scripts": ["pyprinttags=pyprinttags:script"]}, | ||
extras_require={ | ||
"tests": ["pytest"], | ||
}, | ||
python_requires=">=3.6", | ||
) | ||
) |