Skip to content

Commit a7d8bbf

Browse files
authored
bumpy version, merge pull request #17 from tqdm/devel
2 parents 547d620 + 155deba commit a7d8bbf

25 files changed

+341
-424
lines changed

.codecov.yml

Lines changed: 0 additions & 8 deletions
This file was deleted.

.coveragerc

Lines changed: 0 additions & 6 deletions
This file was deleted.

.github/workflows/test.yml

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: Test
2+
on:
3+
push:
4+
pull_request:
5+
schedule: [{cron: '2 3 * * 6'}] # M H d m w (Sat 3:02)
6+
jobs:
7+
check:
8+
if: github.event_name != 'pull_request' || !contains('OWNER,MEMBER,COLLABORATOR', github.event.pull_request.author_association)
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
with: {fetch-depth: 0}
13+
- uses: actions/setup-python@v5
14+
with: {python-version: '3.x'}
15+
- name: dependencies
16+
run: pip install -U tox .
17+
- run: tox -e check
18+
test:
19+
if: github.event_name != 'pull_request' || !contains('OWNER,MEMBER,COLLABORATOR', github.event.pull_request.author_association)
20+
name: py${{ matrix.python }}-${{ matrix.os }}
21+
strategy:
22+
matrix:
23+
os: [ubuntu]
24+
python: [3.7, 3.8, 3.9, '3.10', 3.11]
25+
include:
26+
- os: macos
27+
python: 3.11
28+
- os: windows
29+
python: 3.11
30+
runs-on: ${{ matrix.os }}-latest
31+
defaults:
32+
run:
33+
shell: bash
34+
steps:
35+
- uses: actions/checkout@v4
36+
with: {fetch-depth: 0}
37+
- uses: actions/setup-python@v5
38+
with:
39+
python-version: ${{ matrix.python }}
40+
- name: install
41+
run: |
42+
pip install -U tox tox-gh-actions
43+
mkdir -p "$HOME/bin"
44+
curl -sfL https://coverage.codacy.com/get.sh > "$HOME/bin/codacy"
45+
chmod +x "$HOME/bin/codacy"
46+
echo "$HOME/bin" >> $GITHUB_PATH
47+
- name: tox
48+
run: tox -e py${PYVER/./}
49+
env:
50+
PYVER: ${{ matrix.python }}
51+
PLATFORM: ${{ matrix.os }}
52+
COVERALLS_FLAG_NAME: py${{ matrix.python }}-${{ matrix.os }}
53+
COVERALLS_PARALLEL: true
54+
COVERALLS_SERVICE_NAME: github
55+
# coveralls needs explicit token
56+
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58+
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
59+
finish:
60+
name: pytest cov
61+
continue-on-error: ${{ github.event_name != 'push' }}
62+
needs: test
63+
runs-on: ubuntu-latest
64+
steps:
65+
- uses: actions/setup-python@v5
66+
with: {python-version: '3.x'}
67+
- name: Coveralls Finished
68+
run: |
69+
pip install -U coveralls
70+
coveralls --finish || :
71+
env:
72+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
73+
- name: Codacy Finished
74+
run: |
75+
curl -sfL https://coverage.codacy.com/get.sh > codacy
76+
bash codacy final || :
77+
env:
78+
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
79+
deploy:
80+
needs: [check, test]
81+
runs-on: ubuntu-latest
82+
environment: pypi
83+
permissions: {contents: write, id-token: write, packages: write}
84+
steps:
85+
- uses: actions/checkout@v4
86+
with:
87+
fetch-depth: 0
88+
token: ${{ secrets.GH_TOKEN || github.token }}
89+
- uses: actions/setup-python@v5
90+
with: {python-version: '3.x'}
91+
- id: dist
92+
uses: casperdcl/deploy-pypi@trusted-pub
93+
with:
94+
build: true
95+
upload: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags') }}
96+
- if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
97+
name: Release
98+
run: |
99+
changelog=$(git log --pretty='format:%d%n- %s%n%b---' $(git tag --sort=v:refname | tail -n2 | head -n1)..HEAD)
100+
tag="${GITHUB_REF#refs/tags/}"
101+
gh release create --title "py-make $tag stable" --draft --notes "$changelog" "$tag" dist/${{ steps.dist.outputs.whl }}
102+
env:
103+
GH_TOKEN: ${{ secrets.GH_TOKEN }}

.gitignore

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,15 @@
11
*.py[cod]
2-
3-
# C extensions
42
*.so
3+
__pycache__/
54

65
# Packages
7-
*.egg-info
8-
build/
9-
dist/
6+
/pymake/_dist_ver.py
7+
/*.egg*/
8+
/build/
9+
/dist/
1010

1111
# Unit test / coverage reports
12-
.tox/
13-
.coverage
14-
__pycache__
15-
nosetests.xml
16-
17-
# Translations
18-
*.mo
19-
20-
# Mr Developer
21-
.mr.developer.cfg
22-
.project
23-
.pydevproject
24-
25-
# PyCharm
26-
.idea
12+
/.tox/
13+
/.coverage*
14+
/coverage.xml
15+
/.pytest_cache/

.travis.yml

Lines changed: 0 additions & 44 deletions
This file was deleted.

CONTRIBUTE renamed to CONTRIBUTING.md

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Makefile:
1111

1212
```
1313
make [<alias>] # on UNIX-like environments
14-
python setup.py make [<alias>] # if make is unavailable
14+
python -m pymake [<alias>] # if make is unavailable
1515
```
1616

1717
Use the alias `help` (or leave blank) to list all available aliases.
@@ -50,7 +50,7 @@ The standard way to run the tests:
5050
- run the following command:
5151
5252
```
53-
[python setup.py] make test
53+
[python -m py]make test
5454
# or:
5555
tox --skip-missing-interpreters
5656
```
@@ -66,16 +66,16 @@ you can use `MiniConda` to install a minimal setup. You must also make sure
6666
that each distribution has an alias to call the Python interpreter:
6767
`python27` for Python 2.7's interpreter, `python32` for Python 3.2's, etc.
6868
69-
Alternative unit tests with Nose
69+
Alternative unit tests with PyTest
7070
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7171
72-
Alternatively, use `nose` to run the tests just for the current Python version:
72+
Alternatively, use `pytest` to run the tests just for the current Python version:
7373
74-
- install `nose` and `flake8`
74+
- install `pytest`, `flake8` and `flake8-pyproject`
7575
- run the following command:
7676
7777
```
78-
[python setup.py] make alltests
78+
[python -m py]make alltests
7979
```
8080
8181
@@ -85,7 +85,7 @@ MANAGE A NEW RELEASE
8585
8686
This section is intended for the project's maintainers and describes
8787
how to build and upload a new release. Once again,
88-
`[python setup.py] make [<alias>]` will help.
88+
`[python -m py]make [<alias>]` will help.
8989
9090
9191
SEMANTIC VERSIONING
@@ -104,21 +104,21 @@ Note: tools can be used to automate this process, such as
104104
[python-semanticversion](https://github.com/rbarrois/python-semanticversion/).
105105
106106
107-
CHECKING SETUP.PY
108-
-----------------
107+
CHECKING SETUP
108+
--------------
109109
110-
To check that the `setup.py` file is compliant with PyPi requirements (e.g.
110+
To check that the setup is compliant with PyPi requirements (e.g.
111111
version number; reStructuredText in README.rst) use:
112112
113113
```
114-
[python setup.py] make testsetup
114+
[python -m py]make testsetup
115115
```
116116
117117
To upload just metadata (including overwriting mistakenly uploaded metadata)
118118
to PyPi, use:
119119
120120
```
121-
[python setup.py] make pypimeta
121+
[python -m py]make pypimeta
122122
```
123123
124124
@@ -172,7 +172,7 @@ git merge --no-ff pr-branch-name
172172
~~~~~~
173173
174174
```
175-
[python setup.py] make alltests
175+
[python -m py]make alltests
176176
```
177177
178178
5 Version
@@ -202,9 +202,8 @@ Test
202202
~~~~
203203
204204
- ensure that all online CI tests have passed
205-
- check `setup.py` and `MANIFEST.in` - which define the packaging
206-
process and info that will be uploaded to [pypi](pypi.python.org) -
207-
using `[python setup.py] make installdev`
205+
- check setup - which define the packaging process and info that will be uploaded to [pypi](pypi.python.org) -
206+
using `[python -m py]make install_dev`
208207
209208
Tag
210209
~~~
@@ -221,7 +220,7 @@ Upload
221220
Build pymake into a distributable python package:
222221
223222
```
224-
[python setup.py] make build
223+
[python -m py]make build
225224
```
226225
227226
This will generate several builds in the `dist/` folder. On non-windows
@@ -231,12 +230,12 @@ Finally, upload everything to pypi. This can be done easily using the
231230
[twine](https://github.com/pypa/twine) module:
232231
233232
```
234-
[python setup.py] make pypi
233+
[python -m py]make pypi
235234
```
236235
237236
Also, the new release can (should) be added to `github` by creating a new
238237
release from the web interface; uploading packages from the `dist/` folder
239-
created by `[python setup.py] make build`.
238+
created by `[python -m py]make build`.
240239
241240
Notes
242241
~~~~~
@@ -246,7 +245,7 @@ before the real deployment
246245
- in case of a mistake, you can delete an uploaded release on pypi, but you
247246
cannot re-upload another with the same version number
248247
- in case of a mistake in the metadata on pypi (e.g. bad README),
249-
updating just the metadata is possible: `[python setup.py] make pypimeta`
248+
updating just the metadata is possible: `[python -m py]make pypimeta`
250249
251250
252251
QUICK DEV SUMMARY
@@ -255,12 +254,12 @@ QUICK DEV SUMMARY
255254
For expereinced devs, once happy with local master:
256255
257256
1. bump version in `pymake/_version.py`
258-
2. test (`[python setup.py] make alltests`)
257+
2. test (`[python -m py]make alltests`)
259258
3. `git commit [--amend] # -m "bump version"`
260259
4. `git push`
261260
5. wait for tests to pass
262261
a) in case of failure, fix and go back to (2)
263262
6. `git tag vM.m.p && git push --tags`
264-
7. `[python setup.py] make distclean`
265-
8. `[python setup.py] make build`
266-
9. `[python setup.py] make pypi`
263+
7. `[python -m py]make distclean`
264+
8. `[python -m py]make build`
265+
9. `[python -m py]make pypi`

LICENCE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Exceptions or notable authors are listed below
66
in reverse chronological order:
77

88
* files: *
9-
MPLv2.0 2016-2019 (c) Casper da Costa-Luis
9+
MPLv2.0 2016-2024 (c) Casper da Costa-Luis
1010
[casperdcl](https://github.com/casperdcl).
1111

1212

@@ -15,5 +15,5 @@ Mozilla Public Licence (MPL) v. 2.0 - Exhibit A
1515

1616
This Source Code Form is subject to the terms of the
1717
Mozilla Public License, v. 2.0.
18-
If a copy of the MPL was not distributed with this file,
18+
If a copy of the MPL was not distributed with this project,
1919
You can obtain one at https://mozilla.org/MPL/2.0/.

MANIFEST.in

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)