Skip to content

Commit

Permalink
bumpy version, merge pull request #17 from tqdm/devel
Browse files Browse the repository at this point in the history
  • Loading branch information
casperdcl committed Feb 6, 2024
2 parents 547d620 + 155deba commit a7d8bbf
Show file tree
Hide file tree
Showing 25 changed files with 341 additions and 424 deletions.
8 changes: 0 additions & 8 deletions .codecov.yml

This file was deleted.

6 changes: 0 additions & 6 deletions .coveragerc

This file was deleted.

103 changes: 103 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
name: Test
on:
push:
pull_request:
schedule: [{cron: '2 3 * * 6'}] # M H d m w (Sat 3:02)
jobs:
check:
if: github.event_name != 'pull_request' || !contains('OWNER,MEMBER,COLLABORATOR', github.event.pull_request.author_association)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with: {fetch-depth: 0}
- uses: actions/setup-python@v5
with: {python-version: '3.x'}
- name: dependencies
run: pip install -U tox .
- run: tox -e check
test:
if: github.event_name != 'pull_request' || !contains('OWNER,MEMBER,COLLABORATOR', github.event.pull_request.author_association)
name: py${{ matrix.python }}-${{ matrix.os }}
strategy:
matrix:
os: [ubuntu]
python: [3.7, 3.8, 3.9, '3.10', 3.11]
include:
- os: macos
python: 3.11
- os: windows
python: 3.11
runs-on: ${{ matrix.os }}-latest
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
with: {fetch-depth: 0}
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: install
run: |
pip install -U tox tox-gh-actions
mkdir -p "$HOME/bin"
curl -sfL https://coverage.codacy.com/get.sh > "$HOME/bin/codacy"
chmod +x "$HOME/bin/codacy"
echo "$HOME/bin" >> $GITHUB_PATH
- name: tox
run: tox -e py${PYVER/./}
env:
PYVER: ${{ matrix.python }}
PLATFORM: ${{ matrix.os }}
COVERALLS_FLAG_NAME: py${{ matrix.python }}-${{ matrix.os }}
COVERALLS_PARALLEL: true
COVERALLS_SERVICE_NAME: github
# coveralls needs explicit token
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
finish:
name: pytest cov
continue-on-error: ${{ github.event_name != 'push' }}
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v5
with: {python-version: '3.x'}
- name: Coveralls Finished
run: |
pip install -U coveralls
coveralls --finish || :
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Codacy Finished
run: |
curl -sfL https://coverage.codacy.com/get.sh > codacy
bash codacy final || :
env:
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
deploy:
needs: [check, test]
runs-on: ubuntu-latest
environment: pypi
permissions: {contents: write, id-token: write, packages: write}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GH_TOKEN || github.token }}
- uses: actions/setup-python@v5
with: {python-version: '3.x'}
- id: dist
uses: casperdcl/deploy-pypi@trusted-pub
with:
build: true
upload: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags') }}
- if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
name: Release
run: |
changelog=$(git log --pretty='format:%d%n- %s%n%b---' $(git tag --sort=v:refname | tail -n2 | head -n1)..HEAD)
tag="${GITHUB_REF#refs/tags/}"
gh release create --title "py-make $tag stable" --draft --notes "$changelog" "$tag" dist/${{ steps.dist.outputs.whl }}
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
29 changes: 9 additions & 20 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,26 +1,15 @@
*.py[cod]

# C extensions
*.so
__pycache__/

# Packages
*.egg-info
build/
dist/
/pymake/_dist_ver.py
/*.egg*/
/build/
/dist/

# Unit test / coverage reports
.tox/
.coverage
__pycache__
nosetests.xml

# Translations
*.mo

# Mr Developer
.mr.developer.cfg
.project
.pydevproject

# PyCharm
.idea
/.tox/
/.coverage*
/coverage.xml
/.pytest_cache/
44 changes: 0 additions & 44 deletions .travis.yml

This file was deleted.

47 changes: 23 additions & 24 deletions CONTRIBUTE → CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Makefile:

```
make [<alias>] # on UNIX-like environments
python setup.py make [<alias>] # if make is unavailable
python -m pymake [<alias>] # if make is unavailable
```

Use the alias `help` (or leave blank) to list all available aliases.
Expand Down Expand Up @@ -50,7 +50,7 @@ The standard way to run the tests:
- run the following command:
```
[python setup.py] make test
[python -m py]make test
# or:
tox --skip-missing-interpreters
```
Expand All @@ -66,16 +66,16 @@ you can use `MiniConda` to install a minimal setup. You must also make sure
that each distribution has an alias to call the Python interpreter:
`python27` for Python 2.7's interpreter, `python32` for Python 3.2's, etc.
Alternative unit tests with Nose
Alternative unit tests with PyTest
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Alternatively, use `nose` to run the tests just for the current Python version:
Alternatively, use `pytest` to run the tests just for the current Python version:

- install `nose` and `flake8`
- install `pytest`, `flake8` and `flake8-pyproject`
- run the following command:

```
[python setup.py] make alltests
[python -m py]make alltests
```


Expand All @@ -85,7 +85,7 @@ MANAGE A NEW RELEASE

This section is intended for the project's maintainers and describes
how to build and upload a new release. Once again,
`[python setup.py] make [<alias>]` will help.
`[python -m py]make [<alias>]` will help.


SEMANTIC VERSIONING
Expand All @@ -104,21 +104,21 @@ Note: tools can be used to automate this process, such as
[python-semanticversion](https://github.com/rbarrois/python-semanticversion/).


CHECKING SETUP.PY
-----------------
CHECKING SETUP
--------------

To check that the `setup.py` file is compliant with PyPi requirements (e.g.
To check that the setup is compliant with PyPi requirements (e.g.
version number; reStructuredText in README.rst) use:

```
[python setup.py] make testsetup
[python -m py]make testsetup
```

To upload just metadata (including overwriting mistakenly uploaded metadata)
to PyPi, use:

```
[python setup.py] make pypimeta
[python -m py]make pypimeta
```


Expand Down Expand Up @@ -172,7 +172,7 @@ git merge --no-ff pr-branch-name
~~~~~~
```
[python setup.py] make alltests
[python -m py]make alltests
```
5 Version
Expand Down Expand Up @@ -202,9 +202,8 @@ Test
~~~~
- ensure that all online CI tests have passed
- check `setup.py` and `MANIFEST.in` - which define the packaging
process and info that will be uploaded to [pypi](pypi.python.org) -
using `[python setup.py] make installdev`
- check setup - which define the packaging process and info that will be uploaded to [pypi](pypi.python.org) -
using `[python -m py]make install_dev`
Tag
~~~
Expand All @@ -221,7 +220,7 @@ Upload
Build pymake into a distributable python package:
```
[python setup.py] make build
[python -m py]make build
```
This will generate several builds in the `dist/` folder. On non-windows
Expand All @@ -231,12 +230,12 @@ Finally, upload everything to pypi. This can be done easily using the
[twine](https://github.com/pypa/twine) module:
```
[python setup.py] make pypi
[python -m py]make pypi
```
Also, the new release can (should) be added to `github` by creating a new
release from the web interface; uploading packages from the `dist/` folder
created by `[python setup.py] make build`.
created by `[python -m py]make build`.
Notes
~~~~~
Expand All @@ -246,7 +245,7 @@ before the real deployment
- in case of a mistake, you can delete an uploaded release on pypi, but you
cannot re-upload another with the same version number
- in case of a mistake in the metadata on pypi (e.g. bad README),
updating just the metadata is possible: `[python setup.py] make pypimeta`
updating just the metadata is possible: `[python -m py]make pypimeta`
QUICK DEV SUMMARY
Expand All @@ -255,12 +254,12 @@ QUICK DEV SUMMARY
For expereinced devs, once happy with local master:
1. bump version in `pymake/_version.py`
2. test (`[python setup.py] make alltests`)
2. test (`[python -m py]make alltests`)
3. `git commit [--amend] # -m "bump version"`
4. `git push`
5. wait for tests to pass
a) in case of failure, fix and go back to (2)
6. `git tag vM.m.p && git push --tags`
7. `[python setup.py] make distclean`
8. `[python setup.py] make build`
9. `[python setup.py] make pypi`
7. `[python -m py]make distclean`
8. `[python -m py]make build`
9. `[python -m py]make pypi`
4 changes: 2 additions & 2 deletions LICENCE
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Exceptions or notable authors are listed below
in reverse chronological order:

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


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

This Source Code Form is subject to the terms of the
Mozilla Public License, v. 2.0.
If a copy of the MPL was not distributed with this file,
If a copy of the MPL was not distributed with this project,
You can obtain one at https://mozilla.org/MPL/2.0/.
13 changes: 0 additions & 13 deletions MANIFEST.in

This file was deleted.

0 comments on commit a7d8bbf

Please sign in to comment.