From 1380901a4e6b16a932b9665469f6c0d43b4f1ba8 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Mon, 20 Jun 2022 07:55:40 -0500 Subject: [PATCH 1/2] add a setup.py shim --- hatch_jupyter_builder/migration/_migrate.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hatch_jupyter_builder/migration/_migrate.py b/hatch_jupyter_builder/migration/_migrate.py index 49ca9f9..2cc815f 100644 --- a/hatch_jupyter_builder/migration/_migrate.py +++ b/hatch_jupyter_builder/migration/_migrate.py @@ -182,8 +182,14 @@ if npm_version == current_version: tbump_table["file"].append(dict(src="package.json")) +# Add a setup.py shim. +shim_text = """# setup.py shim for use with applications that require it. +__import__("setuptools").setup() +""" +setup_py.write_text(shim_text, encoding="utf-8") + # Remove old files -for fname in ["MANIFEST.in", "setup.py", "setup.cfg"]: +for fname in ["MANIFEST.in", "setup.cfg"]: if os.path.exists(fname): os.remove(fname) From 4f9b29af2dc3da1d1bbebadf9040437dcea5ccc9 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Mon, 20 Jun 2022 08:03:26 -0500 Subject: [PATCH 2/2] remove dynamic version entry --- hatch_jupyter_builder/migration/_migrate.py | 4 ++++ tests/data/pyproject.toml | 3 --- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/hatch_jupyter_builder/migration/_migrate.py b/hatch_jupyter_builder/migration/_migrate.py index 2cc815f..48c307b 100644 --- a/hatch_jupyter_builder/migration/_migrate.py +++ b/hatch_jupyter_builder/migration/_migrate.py @@ -71,6 +71,10 @@ build_table = hatch_table.setdefault("build", {}) targets_table = build_table.setdefault("targets", {}) +# Remove the dynamic version. +if current_version: + del hatch_table["version"] + # Remove any auto-generated sdist config. if "sdist" in targets_table: del targets_table["sdist"] diff --git a/tests/data/pyproject.toml b/tests/data/pyproject.toml index b7eee5d..50839e6 100644 --- a/tests/data/pyproject.toml +++ b/tests/data/pyproject.toml @@ -38,9 +38,6 @@ version = "0.1.0" [project.urls] Homepage = "https://github.com/github_username/myextension" -[tool.hatch.version] -path = "myextension/__init__.py" - [tool.hatch.build] artifacts = [ "myextension/labextension",