From 1d6b011dc6b7f815ca8aeb92fadaa149224a26b1 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 20 Feb 2024 20:45:01 -0800 Subject: [PATCH 1/3] pyproject.toml: Move packages, package_data here from setup.py --- pyproject.toml | 15 +++++++++++++++ setup.py | 10 ---------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 31cb07e..b1550b8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -54,5 +54,20 @@ full = [ [project.scripts] mathics-generate-json-table = "mathics_scanner.generate.build_tables:main" +[tool.setuptools] +packages = [ + "mathics_scanner", + "mathics_scanner.generate", +] + +[tool.setuptools.package-data] +"mathics_scanner" = [ + "data/named-characters.yml", + "data/*.csv", + "data/characters.json", # List this explicitly since it is needed + "data/*.json", + "data/ExampleData/*", +] + [tool.setuptools.dynamic] version = {attr = "mathics_scanner.version.__version__"} diff --git a/setup.py b/setup.py index 8f0daa0..fc47cbc 100644 --- a/setup.py +++ b/setup.py @@ -99,18 +99,8 @@ def finalize_options(self): setup( cmdclass={"egg_info": table_building_egg_info}, - packages=["mathics_scanner", "mathics_scanner.generate"], install_requires=INSTALL_REQUIRES, extras_require=EXTRAS_REQUIRE, - package_data={ - "mathics_scanner": [ - "data/named-characters.yml", - "data/*.csv", - "data/characters.json", # List this explicitly since it is needed - "data/*.json", - "data/ExampleData/*", - ] - }, # don't pack Mathics in egg because of media files, etc. zip_safe=False, ) From 474f3cc584d204a7f25c767df90dcc48f56ff30b Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 20 Feb 2024 20:45:26 -0800 Subject: [PATCH 2/3] setup.py: Remove unused definitions --- setup.py | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/setup.py b/setup.py index fc47cbc..516551b 100644 --- a/setup.py +++ b/setup.py @@ -46,15 +46,6 @@ def get_srcdir(): return osp.realpath(filename) -def read(*rnames): - return open(osp.join(get_srcdir(), *rnames)).read() - - -is_PyPy = platform.python_implementation() == "PyPy" or hasattr( - sys, "pypy_version_info" -) - - # General Requirements INSTALL_REQUIRES = [ "chardet", # Used in mathics_scanner.feed @@ -75,11 +66,6 @@ def read(*rnames): EXTRAS_REQUIRE[kind] = extras_require -def subdirs(root: str, file="*.*", depth=10): - for k in range(depth): - yield root + "*/" * k + file - - class table_building_egg_info(egg_info): # This runs as part of building an sdist From 43805bd1860951c6172e3df54d41a17e99a982bc Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Tue, 20 Feb 2024 20:47:54 -0800 Subject: [PATCH 3/3] setup.py: Remove INSTALL_REQUIRES, already in pyproject.toml --- pyproject.toml | 8 ++++---- setup.py | 10 ---------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index b1550b8..10216e1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,9 +11,9 @@ build-backend = "setuptools.build_meta" name = "Mathics_Scanner" description = "Character Tables and Tokenizer for Mathics and the Wolfram Language." dependencies = [ - "PyYAML", - "chardet", - "click", + "PyYAML", # Used in mathics-generate-json-table + "chardet", # Used in mathics_scanner.feed + "click", # Using in CLI: mathics-generate-json-table ] requires-python = ">=3.8" readme = "README.rst" @@ -48,7 +48,7 @@ dev = [ "pytest", ] full = [ - "ujson", + "ujson", # Optional Used in mathics_scanner.characters ] [project.scripts] diff --git a/setup.py b/setup.py index 516551b..2cdff24 100644 --- a/setup.py +++ b/setup.py @@ -46,15 +46,6 @@ def get_srcdir(): return osp.realpath(filename) -# General Requirements -INSTALL_REQUIRES = [ - "chardet", # Used in mathics_scanner.feed - "PyYAML", # Used in mathics-generate-json-table - # "ujson", # Optional Used in mathics_scanner.characters - "click", # Using in CLI: mathics-generate-json-table -] - - EXTRAS_REQUIRE = {} for kind in ("dev", "full"): extras_require = [] @@ -85,7 +76,6 @@ def finalize_options(self): setup( cmdclass={"egg_info": table_building_egg_info}, - install_requires=INSTALL_REQUIRES, extras_require=EXTRAS_REQUIRE, # don't pack Mathics in egg because of media files, etc. zip_safe=False,