-
Notifications
You must be signed in to change notification settings - Fork 734
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
Migrate to PEP 518 #1111
Migrate to PEP 518 #1111
Conversation
aa8c9eb
to
bf6d0bf
Compare
Erm, now we need to main two dependency? |
Ah, sorry if I didn't make it clear. The list of runtime dependencies is the same, but it is duplicated twice to conform to a finalized PEP, which would eventually be supported in I brought up There should be little/no change to how contributors develop. |
@elicn what do you think ? |
I think that keeping up to date is always a good idea; see my full feddback at #1109. |
I still dont understand where they are two files. one is TOML and one setuptools ? |
TOML (the PEP standard) is preferred as it would allow support for other build systems. So we have several options:
Sorry if it still doesn't make sense; Python building and packaging is a bit of a mess 😅 |
It's always a big mess but funny things are that everything "just" happens to work. Personally, I prefer |
This comment was marked as resolved.
This comment was marked as resolved.
Additionally, revert setup.py removal, remove setup.cfg and update versions
@nullableVoidPtr there is a conflict to solve :) |
It definitely make package info more readable, I think it should be merged once the conflict is solved. |
Update pyproject.toml to update deps and replace MANIFEST.in
2bf8e37
to
ee0fbed
Compare
I've taken the liberty to remove most of the setup.py code as the TOML code is no longer experimental and should be stable. Also, I've noticed that some variables, like version, can be marked as dynamic and depend on the contents of a file; this may be useful in conjunction with something like setuptools-scm, but I'm not sure how wanted something like that would be. |
One question, we save and read the version number from setup.py This will be a problem if we remove from setup.py |
Okay, so one option is to have If the need for the one version is not needed in FWIW, this diff works wonders: diff --git a/pyproject.toml b/pyproject.toml
index 636daf17..023d426f 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,7 +1,7 @@
[project]
name = "qiling"
-version = "1.4.5-dev"
description = "Qiling is an advanced binary emulation framework that cross-platform-architecture"
+dynamic = ["version"]
readme = "README.md"
requires-python = ">=3.8"
license = {text = "GPL-2.0-only"}
@@ -69,7 +69,7 @@ changelog = "https://github.com/qilingframework/qiling/blob/master/ChangeLog"
qltool = "qltool:main"
[build-system]
-requires = ["setuptools>=61.0.0", "wheel"]
+requires = ["setuptools>=61.0.0", "setuptools_scm[toml]>=6.2", "wheel"]
build-backend = "setuptools.build_meta"
[tool.setuptools.package-data]
@@ -78,3 +78,4 @@ qiling = ["profiles/*.ql"]
"qiling.os.uefi" = ["guids.csv"]
"qiling.arch.evm.analysis" = ["signatures.json"]
+[tool.setuptools_scm] On my machine, this builds version |
I guess there is a problem between qiling and qltools. that is the reason why importlib is there. and having version number in 2 or 3 files is not a good way to do it. @elicn what do you think ? |
I like @nullableVoidPtr's approach and would happily drop the However, I didn't understand what is the problem with Qiling / qltool. |
I dont remember why it all move to importlib, it was in init.py all this while until someone made some changes to it ? maybe @wtdcode knows ? |
The importlib is introduced by @nullableVoidPtr . I moved the version to a single file and get it by manually |
@wtdcode so, this PR is good to go ? some still need some fix ? |
I will again suggest @nullableVoidPtr testing the latest dev branch on the test PyPI. Also, I doubt if our release CI still works after this change, which should be checked on test PyPI, too. Note the release steps are skipped on non-tag commits. |
Checklist
Which kind of PR do you create?
Coding convention?
Extra tests?
Changelog?
Target branch?
One last thing
This PR makes the
qiling
package removes thesetup.py
script and replaces it with the declarativesetup.cfg
file, and ensures that it is compatible with the newpyproject.toml
meta build system specified in PEP 518, as discussed in #1109.Most of the package metadata including dependencies are included in anticipation of PEP 621/631 support in
setuptools
(see pypa/setuptools#1688 and pypa/setuptools#2970). Alternatively, Qiling can use https://github.com/pypa/flit) to rely entirely on the one TOML file, and I believepip
would work just the same.