python-auto-req 0.1.0__tar.gz → 0.4.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,88 @@
1
+ name: Bump Version
2
+
3
+ # Trigger manually from the GitHub Actions UI.
4
+ # Pushes a version-bump commit and a tag using RELEASE_TOKEN (a PAT).
5
+ # A PAT-triggered tag push fires publish.yml via its push:tags event.
6
+ # GITHUB_TOKEN pushes do not trigger other workflows — that is why a PAT is needed.
7
+ #
8
+ # One-time setup:
9
+ # Create a GitHub fine-grained PAT with "Contents: Read and write" on this repo.
10
+ # Add it as repository secret RELEASE_TOKEN (Settings -> Secrets -> Actions).
11
+ on:
12
+ workflow_dispatch:
13
+ inputs:
14
+ bump:
15
+ description: "Version component to increment"
16
+ required: true
17
+ default: "patch"
18
+ type: choice
19
+ options:
20
+ - patch
21
+ - minor
22
+ - major
23
+
24
+ # Needs write access to commit and push the version bump + tag.
25
+ permissions:
26
+ contents: write
27
+
28
+ jobs:
29
+ bump:
30
+ name: "Bump ${{ inputs.bump }} version"
31
+ runs-on: ubuntu-latest
32
+ steps:
33
+ - uses: actions/checkout@v6
34
+ with:
35
+ # PAT so the tag push triggers publish.yml (GITHUB_TOKEN pushes do not).
36
+ token: ${{ secrets.RELEASE_TOKEN }}
37
+
38
+ - uses: actions/setup-python@v6
39
+ with:
40
+ python-version: "3.13"
41
+
42
+ - name: Calculate and write new version
43
+ id: ver
44
+ run: |
45
+ python - <<'EOF'
46
+ import os, re, tomllib
47
+
48
+ with open("pyproject.toml", "rb") as f:
49
+ current = tomllib.load(f)["project"]["version"]
50
+
51
+ major, minor, patch = map(int, current.split("."))
52
+ bump = os.environ["BUMP"]
53
+
54
+ if bump == "major":
55
+ major += 1; minor = 0; patch = 0
56
+ elif bump == "minor":
57
+ minor += 1; patch = 0
58
+ else:
59
+ patch += 1
60
+
61
+ new = f"{major}.{minor}.{patch}"
62
+
63
+ text = open("pyproject.toml").read()
64
+ text = re.sub(
65
+ r'^(version\s*=\s*)"[^"]+"',
66
+ rf'\g<1>"{new}"',
67
+ text,
68
+ flags=re.MULTILINE,
69
+ )
70
+ open("pyproject.toml", "w").write(text)
71
+
72
+ print(f"Bumped {current} -> {new}")
73
+ with open(os.environ["GITHUB_OUTPUT"], "a") as out:
74
+ out.write(f"old={current}\n")
75
+ out.write(f"new={new}\n")
76
+ EOF
77
+ env:
78
+ BUMP: ${{ inputs.bump }}
79
+
80
+ - name: Commit, tag, and push
81
+ run: |
82
+ git config user.name "github-actions[bot]"
83
+ git config user.email "github-actions[bot]@users.noreply.github.com"
84
+ git add pyproject.toml
85
+ git commit -m "chore: bump version ${{ steps.ver.outputs.old }} -> ${{ steps.ver.outputs.new }}"
86
+ git tag "v${{ steps.ver.outputs.new }}"
87
+ git push
88
+ git push --tags
@@ -0,0 +1,23 @@
1
+ # Contributing
2
+
3
+ Contributions are welcome and appreciated. By submitting a pull request you agree to release your contribution under the [MIT License](LICENSE).
4
+
5
+ ## How to contribute
6
+
7
+ 1. Fork the repository and create a branch from `main`.
8
+ 2. Install the project in development mode:
9
+ ```bash
10
+ pip install -e ".[dev]"
11
+ ```
12
+ 3. Make your changes and add tests where appropriate.
13
+ 4. Run the test suite:
14
+ ```bash
15
+ pytest
16
+ ```
17
+ 5. Open a pull request describing what you changed and why.
18
+
19
+ ## Guidelines
20
+
21
+ - Keep changes focused — one fix or feature per pull request.
22
+ - There is no formal style guide; just match the surrounding code.
23
+ - All contributions, including bug reports and feature requests via issues, are welcome.
@@ -1,11 +1,10 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-auto-req
3
- Version: 0.1.0
3
+ Version: 0.4.0
4
4
  Summary: Scan project source files and populate requirements.txt – with PyPI search and interactive resolution.
5
5
  Project-URL: Homepage, https://github.com/Amit-Roy/python-auto-req
6
6
  Project-URL: Repository, https://github.com/Amit-Roy/python-auto-req
7
7
  Project-URL: Issues, https://github.com/Amit-Roy/python-auto-req/issues
8
- Author-email: Amit Roy <a.roy.0593@gmail.com>
9
8
  License: MIT
10
9
  License-File: LICENSE
11
10
  Keywords: dependencies,pypi,requirements,scanner
@@ -131,47 +130,4 @@ pytest
131
130
 
132
131
  ---
133
132
 
134
- ## Publishing to PyPI
135
-
136
- Publishing is handled automatically by GitHub Actions ([.github/workflows/publish.yml](.github/workflows/publish.yml)) whenever you push a version tag.
137
-
138
- ### One-time PyPI Trusted Publisher setup
139
-
140
- 1. Go to <https://pypi.org/manage/account/publishing/>
141
- 2. Add a **pending publisher** with:
142
- - **PyPI project name**: `python-auto-req`
143
- - **GitHub owner**: `Amit-Roy`
144
- - **Repository name**: `python-auto-req`
145
- - **Workflow filename**: `publish.yml`
146
- - **Environment name**: `pypi`
147
- 3. On GitHub, create a repository **Environment** named `pypi`
148
- *(Settings → Environments → New environment)*
149
-
150
- ### Releasing a new version
151
-
152
- ```bash
153
- # 1. Bump the version in pyproject.toml (and src/auto_req/__init__.py)
154
- # 2. Commit and push
155
- git add pyproject.toml src/auto_req/__init__.py
156
- git commit -m "chore: release v0.2.0"
157
- git push
158
-
159
- # 3. Tag and push – this triggers the publish workflow
160
- git tag v0.2.0
161
- git push --tags
162
- ```
163
-
164
- The workflow will:
165
- 1. Run the full test matrix
166
- 2. Build wheel + sdist
167
- 3. Verify the tag matches the package version
168
- 4. Publish to PyPI via OIDC (no API token required)
169
-
170
- ### Local build (optional)
171
-
172
- ```bash
173
- pip install -e ".[dev]"
174
- python -m build
175
- ```
176
-
177
- MIT
133
+ [MIT License](LICENSE)
@@ -101,47 +101,4 @@ pytest
101
101
 
102
102
  ---
103
103
 
104
- ## Publishing to PyPI
105
-
106
- Publishing is handled automatically by GitHub Actions ([.github/workflows/publish.yml](.github/workflows/publish.yml)) whenever you push a version tag.
107
-
108
- ### One-time PyPI Trusted Publisher setup
109
-
110
- 1. Go to <https://pypi.org/manage/account/publishing/>
111
- 2. Add a **pending publisher** with:
112
- - **PyPI project name**: `python-auto-req`
113
- - **GitHub owner**: `Amit-Roy`
114
- - **Repository name**: `python-auto-req`
115
- - **Workflow filename**: `publish.yml`
116
- - **Environment name**: `pypi`
117
- 3. On GitHub, create a repository **Environment** named `pypi`
118
- *(Settings → Environments → New environment)*
119
-
120
- ### Releasing a new version
121
-
122
- ```bash
123
- # 1. Bump the version in pyproject.toml (and src/auto_req/__init__.py)
124
- # 2. Commit and push
125
- git add pyproject.toml src/auto_req/__init__.py
126
- git commit -m "chore: release v0.2.0"
127
- git push
128
-
129
- # 3. Tag and push – this triggers the publish workflow
130
- git tag v0.2.0
131
- git push --tags
132
- ```
133
-
134
- The workflow will:
135
- 1. Run the full test matrix
136
- 2. Build wheel + sdist
137
- 3. Verify the tag matches the package version
138
- 4. Publish to PyPI via OIDC (no API token required)
139
-
140
- ### Local build (optional)
141
-
142
- ```bash
143
- pip install -e ".[dev]"
144
- python -m build
145
- ```
146
-
147
- MIT
104
+ [MIT License](LICENSE)
@@ -4,11 +4,10 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "python-auto-req"
7
- version = "0.1.0"
7
+ version = "0.4.0"
8
8
  description = "Scan project source files and populate requirements.txt – with PyPI search and interactive resolution."
9
9
  readme = "README.md"
10
10
  license = { text = "MIT" }
11
- authors = [{ name = "Amit Roy", email = "a.roy.0593@gmail.com" }]
12
11
  requires-python = ">=3.10"
13
12
  keywords = ["requirements", "dependencies", "pypi", "scanner"]
14
13
  classifiers = [
File without changes