Repository navigation
build: move to pyproject.toml and drop python 3.6 - #52
Conversation
Replace setup.py, setup.cfg, and pytest.ini with pyproject.toml, matching python-slack-sdk, bolt-python, and python-slack-hooks. The new floor is Python 3.7. A Python CI workflow runs the tests on 3.7 to 3.15 and PyPy, and tests that need live Discovery API tokens now skip without them. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
The license is now an SPDX expression with LICENSE.md as its license file. This needs setuptools 77 or newer, which runs on Python 3.9+, so the package is built on the latest Python. The py3-none-any wheel still installs on 3.7+. Because of this, the unit test jobs and install.sh no longer install the package (that would build it on 3.7/3.8). The tests import it from source, as in python-slack-sdk. MANIFEST.in is dropped: setuptools already ships README.md, LICENSE.md, and py.typed. PyPy is dropped from the classifiers and the test matrix since it isn't tested. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
mwbrooks
left a comment
There was a problem hiding this comment.
Thanks @WilliamBergamin, this is close! Two small fixes to the install docs and then it's good to go.
| cd ${script_dir}/.. | ||
|
|
||
| pip install -U pip | ||
| pip install -r requirements/testing.txt |
There was a problem hiding this comment.
issue (blocking): This no longer installs the SDK itself, so following the README and running an example fails with ModuleNotFoundError. Adding pip install -e . here would match the old pip install -e ".[testing]" step.
There was a problem hiding this comment.
Good catch, thanks! Added pip install -e . back in aa614b8. It works on 3.7 again now that the setuptools 77 floor is gone (see the license thread).
There was a problem hiding this comment.
Thanks, that settles it! Confirmed pip install -e . and importing the SDK both work with the latest setuptools.
| @@ -1,18 +0,0 @@ | |||
| # Copyright 2021, Slack Technologies, LLC. All rights reserved. | |||
There was a problem hiding this comment.
issue (blocking): The README still points to this script in its "run all of the examples at once" section. Could we keep the script or drop that section?
There was a problem hiding this comment.
Restored it as-is from main in aa614b8, so the README section still works.
There was a problem hiding this comment.
Perfect, thanks for keeping the README flow working!
| @@ -0,0 +1,56 @@ | |||
| [build-system] | |||
| requires = ["setuptools>=77"] | |||
There was a problem hiding this comment.
suggestion (non-blocking): license = { text = "MIT" } like python-slack-sdk would drop the setuptools 77 floor, so sdist installs work on 3.7 and 3.8.
There was a problem hiding this comment.
Took this, thanks! Switched to license = { text = "MIT" } like python-slack-sdk in aa614b8. That removes the setuptools 77 floor, so source installs and pip install -e . work on 3.7 and 3.8 again.
There was a problem hiding this comment.
Thanks for taking this one! Heads up, setuptools now warns the table form stops being supported after 2027-02-18, so the SDKs will want the SPDX string once 3.7 and 3.8 are dropped.
The license goes back to license = { text = "MIT" }, like
python-slack-sdk, bolt-python, and python-slack-hooks. Without the
PEP 639 form, setuptools no longer needs to be 77 or newer, so the
package builds and installs from source on 3.7 and 3.8 again.
That lets install.sh run pip install -e . once more, so the README
setup flow can import the SDK when running the examples. run_all.sh is
restored because the README still points to it for running every
example.
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
mwbrooks
left a comment
There was a problem hiding this comment.
✅ Thanks @WilliamBergamin! Bringing back the editable install and run_all.sh means the README setup runs end to end on every supported Python again.
Co-authored-by: Claude <svc-devxp-claude@slack-corp.com>
mwbrooks
left a comment
There was a problem hiding this comment.
✅ Thanks @WilliamBergamin, the restored install and the license switch make this a smooth move for 3.7 users too!
Summary
This pull request moves packaging to
pyproject.tomland raises the minimum Python version to 3.7, matching python-slack-sdk, bolt-python, and python-slack-hooks. It's the first of 4 stacked PRs that align this repo's tooling with theirs.setup.py,setup.cfg, andpytest.iniare replaced bypyproject.tomlandrequirements/*.txt. The license useslicense = { text = "MIT" }like python-slack-sdk, so the package builds and installs on 3.7+scripts/, plus a Python CI workflow that runs unit tests on 3.7 to 3.15 and reports coverage to Codecov. It replacespy_compile.yml.liveand skip whenSLACK_DISCOVERY_SDK_TEST_ENTERPRISE_TOKENis unset, so CI can run without tokensTesting
./scripts/install.sh && ./scripts/run_tests.shon 3.7 and 3.15: offline tests pass, live tests skip./scripts/build_pypi_package.shon 3.15: the wheel ispy3-none-any(no longeruniversal) and includespy.typedandLICENSE.md; it installs and imports on 3.7 and 3.8CODECOV_TOKENrepo secret for the coverage uploadRequirements
🤖 Generated with Claude Code