diff --git a/_compiled_pyproject.toml b/_compiled_pyproject.toml index a6cffbf39aea37..93a9a243a6c3b6 100644 --- a/_compiled_pyproject.toml +++ b/_compiled_pyproject.toml @@ -1,8 +1,23 @@ +[project] +name = "compiled" +version = "0.2.1" +description = "Compiled versions of the stdlib." +# TODO: Add README +authors = [ + {name = "Tushar Sadhwani", email = "tushar.sadhwani000@gmail.com"}, +] +requires-python = ">=3.11" + +[project.urls] +Homepage = "https://github.com/tusharsadhwani/compiled" + +[project.scripts] +pycompile = "compiled:cli" + [build-system] requires = [ "setuptools", "wheel", "mypy[mypyc]", ] - build-backend = "setuptools.build_meta" diff --git a/build.py b/build.py index ffc81e01e6f6c8..d28c2f8ee8ea79 100755 --- a/build.py +++ b/build.py @@ -15,7 +15,6 @@ TEST_BASE_DIR = os.path.join(ROOT_DIR, "Lib/test") TMP_LIB_DIR = "/tmp/pycompiled" -PACKAGE_VERSION = "0.2.1" SUPPORTED_LIBRARIES = ["tomllib", "difflib"] # get rid of this once mypyc fixes relative imports @@ -239,25 +238,18 @@ def main() -> int: init_file.write(contents) # copy cibuildwheel config to build dir - shutil.copy("./cibw_config.toml", build_dir) + pyproject_toml_path = os.path.join(build_dir, "pyproject.toml") + shutil.copy("./_compiled_pyproject.toml", pyproject_toml_path) # setup.py contains the `pycompile` console script, present in `__init__.py` with contextlib.chdir(build_dir): setup_code = dedent( - # TODO: use a setup.cfg for README, version, and all the static stuff. r""" from setuptools import setup, find_packages from mypyc.build import mypycify setup( - name="compiled", - version=%r, - description="Compiled versions of the stdlib.", - long_description="# compiled\n\nCompiled versions of the stdlib.", - url="https://github.com/tusharsadhwani/compiled", - author="Tushar Sadhwani", - author_email="tushar.sadhwani000@gmail.com", packages=find_packages(), ext_modules=mypycify(["--strict", *%r]), entry_points={ @@ -265,12 +257,12 @@ def main() -> int: }, ) """ - % (PACKAGE_VERSION, ext_modules) + % (ext_modules,) ) with open("./setup.py", "w") as setup_file: setup_file.write(setup_code) - process = subprocess.run(["cibuildwheel", "--config-file=cibw_config.toml"]) + process = subprocess.run(["cibuildwheel"]) return process.returncode library_name = args.library