Skip to content

Commit fc42778

Browse files
committed
Allow for pep440 releases
1 parent 30a9827 commit fc42778

3 files changed

Lines changed: 45 additions & 1 deletion

File tree

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Released Version Check
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
8+
jobs:
9+
check-stable-resolution:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Wait for PyPI indexing
13+
run: sleep 180
14+
15+
- name: Set up Python
16+
uses: actions/setup-python@v5
17+
with:
18+
python-version: '3.11'
19+
20+
- name: Install from PyPI (no --pre)
21+
run: |
22+
python -m venv /tmp/check-venv
23+
/tmp/check-venv/bin/pip install salesforce-data-customcode
24+
25+
- name: Verify resolved version is stable
26+
run: |
27+
VERSION=$(/tmp/check-venv/bin/pip show salesforce-data-customcode | grep ^Version: | awk '{print $2}')
28+
echo "Resolved version: $VERSION"
29+
if echo "$VERSION" | grep -qE '(\.dev|a|b|rc)[0-9]+'; then
30+
echo "::error::pip install (no --pre) resolved to pre-release version: $VERSION"
31+
exit 1
32+
fi
33+
echo "Version $VERSION is stable."

CONTRIBUTING.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,17 @@ See the [Prerequisites section in README.md](./README.md#prerequisites) for comp
7878

7979
**Tip**: See the [README.md](./README.md) for additional `datacustomcode` commands (`scan`, `deploy`, `zip`) to test specific code paths and validate your SDK changes thoroughly.
8080

81+
## Versioning and Pre-Releases
82+
83+
This project uses [PEP 440](https://peps.python.org/pep-0440/) version syntax. Versions are derived automatically from git tags via `poetry-dynamic-versioning`.
84+
85+
- **Stable releases** use tags like `v4.1.0` → published as `4.1.0` on PyPI.
86+
- **Pre-releases** use tags like `v4.1.0.dev1`, `v4.1.0rc1` → published as `4.1.0.dev1`, `4.1.0rc1` on PyPI.
87+
88+
Pre-release versions are **never** resolved by `pip install salesforce-data-customcode` unless the user explicitly passes `--pre`. This ensures customers always get stable releases by default.
89+
90+
A Github Action (`Released Version Check`) runs after every publish to verify that bare `pip install` still resolves to a stable version.
91+
8192
## Makefile Commands
8293

8394
```bash

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ datacustomcode = "datacustomcode.cli:cli"
134134
[tool.poetry-dynamic-versioning]
135135
enable = true
136136
pattern = "^v(?P<base>.+)$"
137-
style = "semver"
137+
style = "pep440"
138138
vcs = "git"
139139

140140
[tool.pytest.ini_options]

0 commit comments

Comments
 (0)