-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Modernize Python metadata #58
Conversation
I had to comment out the rather unusual |
pyproject.toml
Outdated
|
||
[project] | ||
name = "Mathics_Scanner" | ||
version = "1.3.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How can we this read in from `mathics_scanner/version.py?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, wait. I see it getting set below. So does it need to be set here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Fixed in 104c114
setup.py
Outdated
@@ -145,4 +107,4 @@ def build_json_table() -> int: | |||
return result.returncode | |||
|
|||
|
|||
atexit.register(build_json_table) | |||
# atexit.register(build_json_table) ## does not work with build isolation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In setup we need to build some tables.
Can this be done in that dynamic section like it is for "version"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In setup we need to build some tables.
If users download the sdist (source tarball) from PyPI, would the tables be included there, or would they be built on the user's system?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In setup we need to build some tables.
If users download the sdist (source tarball) from PyPI, would the tables be included there, or would they be built on the user's system?
Tables are included in PyPI tarballs, eggs, and wheel. This is done via https://github.com/Mathics3/mathics-scanner/blob/master/setup.py#L102-L104 along with Makefile targets which make sure files are around in development.
I think this was also added to setup.py
as a way to generate tables as well if make
isn't used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this was also added to
setup.py
as a way to generate tables as well
Yes, that's the one that I had to comment out.
I've just pushed a change (52fbe3d that does this in the egg_info
phase of building an sdist (or wheel)
@mkoeppe Overall I like this PR and it is needed. To get to 3.12 we'll need do this not just here but also in mathics-core. Note that the CI failure are not a problem of this PR, but a problem in master. That should now be fixed though. |
52fbe3d
to
316c3ae
Compare
Thanks. I've rebased on top of it |
Here are diffs to make black happy: index c7efc5b..b2f845a 100755
--- a/mathics_scanner/generate/build_tables.py
+++ b/mathics_scanner/generate/build_tables.py
@@ -15,7 +15,7 @@ try:
from mathics_scanner.version import __version__
except ImportError:
# When using build isolation
- __version__ = 'unknown'
+ __version__ = "unknown"
def get_srcdir():
diff --git a/setup.py b/setup.py
index cf4dfd5..d0c7634 100644
--- a/setup.py
+++ b/setup.py
@@ -86,11 +86,15 @@ class table_building_egg_info(egg_info):
def finalize_options(self):
"""Run program to create JSON tables"""
- build_tables_program = osp.join(get_srcdir(), "mathics_scanner", "generate", "build_tables.py")
+ build_tables_program = osp.join(
+ get_srcdir(), "mathics_scanner", "generate", "build_tables.py"
+ )
print(f"Building JSON tables via {build_tables_program}")
result = subprocess.run([sys.executable, build_tables_program])
if result.returncode:
- raise RuntimeError(f"Running {build_tables_program} exited with code {result.returncode}")
+ raise RuntimeError(
+ f"Running {build_tables_program} exited with code {result.returncode}"
+ )
super().finalize_options()
|
Looks Great - Many thanks! |
Using pyproject.toml