Skip to content

chore: migrate to uv, src layout, and PEP 8 package name#79

Open
n3rada wants to merge 5 commits into
forcedotcom:masterfrom
n3rada:master
Open

chore: migrate to uv, src layout, and PEP 8 package name#79
n3rada wants to merge 5 commits into
forcedotcom:masterfrom
n3rada:master

Conversation

@n3rada

@n3rada n3rada commented Jun 12, 2026

Copy link
Copy Markdown

Hello 👋

I took some time to modernise the packaging of this project so it is easier to contribute to and install from.

What Changed

  • Replaced setup.py, setup.cfg, requirements.txt, and requirements-dev.txt with a single pyproject.toml compliant with PEP 621, using uv_build as the build backend.
  • Moved the package into a src/ layout, which is now the recommended structure for Python projects to avoid import shadowing issues.
  • Renamed the package directory from SalesforcePy/ to salesforcepy/ to follow PEP 8 (lowercase package names).
  • Updated all test files and docs to reflect the new import name (import salesforcepy as sfdc).
  • Added pythonpath = ["src", "tests"] to the pytest config so tests resolve correctly without any install step.
  • Added all co-authors from the module docstrings to pyproject.toml.
  • Dropped from __future__ import absolute_import across all modules (Python 2 compatibility shim, not needed on Python 3).
  • Dropped the try/except ImportError urllib compat block in sfdc.py for the same reason.
  • Fixed two SyntaxWarning caused by invalid escape sequences (\**kwargs) in docstrings.
  • Updated README.md with installation instructions for uv and pip.

All 79 existing tests pass without modification to the test logic itself.

Hope this is useful.

Happy to adjust anything.

@salesforce-cla

Copy link
Copy Markdown

Thanks for the contribution! Before we can merge this, we need @n3rada to sign the Salesforce Inc. Contributor License Agreement.

@n3rada

n3rada commented Jun 12, 2026

Copy link
Copy Markdown
Author

This PR also resolves #74. By locking dependencies with uv, requests resolves to 2.34.2, well past the 2.32.0 security fix from that Dependabot bump.

@n3rada

n3rada commented Jun 12, 2026

Copy link
Copy Markdown
Author

This PR also addresses #68. The pyproject.toml sets requires-python = ">=3.11,<4.0", formally dropping all EOL Python versions (3.5, 3.6, 3.7, 3.8, 3.9, 3.10) and setting the floor at the current stable release.

@n3rada

n3rada commented Jun 12, 2026

Copy link
Copy Markdown
Author

Tangentially related to #67 as well: the old .travis.yml is now superseded. With pyproject.toml and uv in place, setting up a GitHub Actions workflow to replace it would be straightforward (uv run pytest is all it needs).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant