Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setup.py cleanup #60

Merged
merged 3 commits into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 19 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -48,11 +48,26 @@ dev = [
"pytest",
]
full = [
"ujson",
"ujson", # Optional Used in mathics_scanner.characters
]

[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__"}
34 changes: 0 additions & 34 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,24 +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
"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 = []
Expand All @@ -75,11 +57,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

Expand All @@ -99,18 +76,7 @@ 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,
)
Loading