Skip to content

Conversation

dennisvang
Copy link
Contributor

Moves metadata from setup.py to a minimal pyproject.toml.

A minimal version of setup.py is maintained for compatibility reasons.

Tested with freecad v19.

Fixes #15

@@ -0,0 +1,31 @@
# References:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Can you also update Makefile?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Patch to start with:

diff --git a/Makefile b/Makefile
index 8149166..75e6645 100644
--- a/Makefile
+++ b/Makefile
@@ -11,6 +11,7 @@ WORKBENCH_TRANSLATION_CONTEXT = cool
 MAINTAINER = me
 EMAIL = [email protected]
 URL = https://foobar.com/me/coolWB
+VERSION = 0.0.0
 DESCRIPTION = The cool WB creates cool parametric objects
 DEPENDENCIES_LIST = []
 
@@ -25,7 +26,8 @@ replace_strings:
 	sed -i 's/workbench_starterkit/$(WORKBENCH_DIR_NAME)/g' freecad/workbench_starterkit/init_gui.py
 	sed -i 's/workbench_starterkit/$(WORKBENCH_DIR_NAME)/g' freecad/workbench_starterkit/resources/translations/update_translation.sh
 	sed -i 's/workbench_starterkit/$(WORKBENCH_DIR_NAME)/g' freecad/workbench_starterkit/resources/translations/workbench_starterkit_es-ES.ts
-	sed -i 's/workbench_starterkit/$(WORKBENCH_DIR_NAME)/g' setup.py
+	sed -i "s/__version__ = .*/__version__ = \'$(VERSION)\'/g" freecad/workbench_starterkit/version.py
+	sed -i 's/workbench_starterkit/$(WORKBENCH_DIR_NAME)/g' pyproject.toml
 	@# Rename workbench class name
 	sed -i 's/TemplateWorkbench/$(WORKBENCH_CLASS_NAME)/g' freecad/workbench_starterkit/init_gui.py
 	@# Rename workbench class properties
@@ -39,12 +41,12 @@ replace_strings:
 	sed -i 's/starterkit/$(WORKBENCH_TRANSLATION_CONTEXT)/g' freecad/workbench_starterkit/resources/translations/workbench_starterkit_es-ES.ts
 	@# Rename workbench directory
 	mv freecad/workbench_starterkit freecad/$(WORKBENCH_DIR_NAME)
-	@# Update setup.py file
-	sed -i 's/looooo/$(MAINTAINER)/g' setup.py
-	sed -i 's/[email protected]/$(EMAIL)/g' setup.py
-	sed -i 's|https://github.com/FreeCAD/Workbench-Starterkit|$(URL)|g' setup.py
-	sed -i 's/template for a freecad extensions\, installable with pip/$(DESCRIPTION)/g' setup.py
-	sed -i "s/\['numpy'\]/$(DEPENDENCIES_LIST)/g" setup.py
+	@# Update pyproject.toml file
+	sed -i 's/looooo/$(MAINTAINER)/g' pyproject.toml
+	sed -i 's/[email protected]/$(EMAIL)/g' pyproject.toml
+	sed -i 's|https://github.com/FreeCAD/freecad.workbench_starterkit|$(URL)|g' pyproject.toml
+	sed -i 's/template for a freecad extensions\, installable with pip/$(DESCRIPTION)/g' pyproject.toml
+	sed -i "s/\[\"numpy\"\]/$(DEPENDENCIES_LIST)/g" pyproject.toml
 
 self-destruction:
 	echo "Remove Makefile"

@dennisvang dennisvang closed this by deleting the head repository Aug 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move package metadata from setup.py to pyproject.toml?
2 participants