From 421876ab0f9098cdc21f7c973d8f18b2488a8fc9 Mon Sep 17 00:00:00 2001 From: Andrew Cassidy Date: Sun, 3 Apr 2022 20:41:02 -0700 Subject: [PATCH] Move more metadata to pyproject.toml --- pyproject.toml | 3 +++ setup.py | 12 +----------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 7f38e55..8a7ea04 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -49,5 +49,8 @@ quicktex = "quicktex.__main__:main" [tool.setuptools] zip-safe = false +packages = { find = { include = ["quicktex*"] } } # only include quicktex and not tests +package-data = { '*' = ['py.typed', '*.pyi'] } # include stubs +package-dir = { '' = '.' } # without this line, C++ source files get included in the bdist [tool.setuptools_scm] diff --git a/setup.py b/setup.py index 45cdb42..89042b0 100644 --- a/setup.py +++ b/setup.py @@ -1,17 +1,13 @@ import os import re import sys -import glob import subprocess -from setuptools import setup, Extension, find_packages +from setuptools import setup, Extension from setuptools.command.build_ext import build_ext project_path = os.path.dirname(os.path.realpath(__file__)) -with open(os.path.join(project_path, 'README.md')) as f: - readme = f.read() - # A CMakeExtension needs a sourcedir instead of a file list. # The name must be the _single_ output extension from the CMake build. @@ -111,16 +107,10 @@ class CMakeBuild(build_ext): ) -# Find stub files -stubs = [path.replace('quicktex/', '') for path in glob.glob('quicktex/**/*.pyi', recursive=True)] - # The information here can also be placed in setup.cfg - better separation of # logic and declaration, and simpler if you include description/version in a file. setup( use_scm_version=True, ext_modules=[CMakeExtension("_quicktex")], cmdclass={"build_ext": CMakeBuild}, - packages=find_packages(where='.', include=['quicktex*']), - package_dir={'': '.'}, - package_data={'': ['py.typed'] + stubs}, )