Skip to content

build: move to pyproject.toml and drop python 3.6 - #52

Merged
WilliamBergamin merged 4 commits into
mainfrom
pyproject
Nov 17, 2026
Merged

WilliamBergamin merged 4 commits into
mainfrom
pyproject

Conversation

@WilliamBergamin

@WilliamBergamin WilliamBergamin commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This pull request moves packaging to pyproject.toml and 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, and pytest.ini are replaced by pyproject.toml and requirements/*.txt. The license uses license = { text = "MIT" } like python-slack-sdk, so the package builds and installs on 3.7+
  • Adds the shared scripts/, plus a Python CI workflow that runs unit tests on 3.7 to 3.15 and reports coverage to Codecov. It replaces py_compile.yml.
  • Tests that call the real Discovery API are marked live and skip when SLACK_DISCOVERY_SDK_TEST_ENTERPRISE_TOKEN is unset, so CI can run without tokens

Testing

  • ./scripts/install.sh && ./scripts/run_tests.sh on 3.7 and 3.15: offline tests pass, live tests skip
  • ./scripts/build_pypi_package.sh on 3.15: the wheel is py3-none-any (no longer universal) and includes py.typed and LICENSE.md; it installs and imports on 3.7 and 3.8
  • Needs a CODECOV_TOKEN repo secret for the coverage upload

Requirements

🤖 Generated with Claude Code

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>
@codecov-commenter

codecov-commenter commented Nov 16, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 14.08451% with 61 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@260a2db). Learn more about missing BASE report.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
slack_discovery_sdk/client.py 18.18% 18 Missing ⚠️
slack_discovery_sdk/base_client.py 9.09% 10 Missing ⚠️
slack_discovery_sdk/rate_limit_support.py 0.00% 6 Missing ⚠️
...y_sdk/examples/user_based_eDiscovery_with_edits.py 0.00% 5 Missing ⚠️
slack_discovery_sdk/examples/DLP_call_pattern.py 0.00% 4 Missing ⚠️
...very_sdk/examples/user_based_eDiscovery_pattern.py 0.00% 4 Missing ⚠️
slack_discovery_sdk/examples/utils.py 0.00% 4 Missing ⚠️
slack_discovery_sdk/examples/audit_logs_pattern.py 0.00% 3 Missing ⚠️
...lack_discovery_sdk/examples/get_enterprise_info.py 0.00% 2 Missing ⚠️
slack_discovery_sdk/internal_utils.py 71.42% 2 Missing ⚠️
... and 2 more
Additional details and impacted files
@@           Coverage Diff           @@
##             main      #52   +/-   ##
=======================================
  Coverage        ?   23.86%           
=======================================
  Files           ?       17           
  Lines           ?      637           
  Branches        ?        0           
=======================================
  Hits            ?      152           
  Misses          ?      485           
  Partials        ?        0           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

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>
@WilliamBergamin
WilliamBergamin marked this pull request as ready for review November 16, 2026 19:41
@WilliamBergamin
WilliamBergamin requested a review from a team as a code owner November 16, 2026 19:41
@WilliamBergamin WilliamBergamin self-assigned this Nov 16, 2026
@WilliamBergamin WilliamBergamin added the dependencies Pull requests that update a dependency file label Nov 16, 2026

@mwbrooks mwbrooks left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @WilliamBergamin, this is close! Two small fixes to the install docs and then it's good to go.

Comment thread scripts/install.sh
cd ${script_dir}/..

pip install -U pip
pip install -r requirements/testing.txt

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks, that settles it! Confirmed pip install -e . and importing the SDK both work with the latest setuptools.

Comment thread scripts/run_all.sh
@@ -1,18 +0,0 @@
# Copyright 2021, Slack Technologies, LLC. All rights reserved.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Restored it as-is from main in aa614b8, so the README section still works.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Perfect, thanks for keeping the README flow working!

Comment thread pyproject.toml Outdated
@@ -0,0 +1,56 @@
[build-system]
requires = ["setuptools>=77"]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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 mwbrooks left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

✅ 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 mwbrooks left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

✅ Thanks @WilliamBergamin, the restored install and the license switch make this a smooth move for 3.7 users too!

@WilliamBergamin
WilliamBergamin merged commit eb28a25 into main Nov 17, 2026
23 of 25 checks passed
@WilliamBergamin
WilliamBergamin deleted the pyproject branch November 17, 2026 19:48
@WilliamBergamin WilliamBergamin mentioned this pull request Nov 17, 2026
3 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants