Skip to content

Commit

Permalink
Merge pull request #289 from lbl-anp/v0.4.2
Browse files Browse the repository at this point in the history
Version v0.4.2 and pre-commit rules/CI integration
  • Loading branch information
jccurtis authored Oct 5, 2021
2 parents c914fc1 + b46da46 commit eb16033
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 48 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/pypi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ jobs:

strategy:
matrix:
os: [ 'macos-latest', 'ubuntu-20.04', 'windows-latest' ]
python-version: ['3.6', '3.7', '3.8', '3.9']
os: [ 'ubuntu-20.04' ]
python-version: [ '3.9' ]
runs-on: ${{ matrix.os }}

steps:
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Run pre-commit
run: |
pip install pre-commit
pre-commit install
pre-commit run --all-files --show-diff-on-failure
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
Expand Down
12 changes: 11 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Exclude CNF and cnf files
exclude: '(?:\.cnf|\.CNF)$'
repos:
- repo: https://github.com/psf/black
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-added-large-files
- id: check-toml
- id: check-yaml
- repo: https://github.com/psf/black
rev: 21.4b2
hooks:
- id: black
44 changes: 7 additions & 37 deletions RELEASING.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,13 @@
## 1. Create Tagged Release
# Create Tagged Release

We follow the `git flow` [release process](https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow).
We (loosely) follow the `git flow` [release process](https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow).

- [ ] Pull the most recent version of `main`
- [ ] Branch off of `main` and name the branch `release-X.X.X` or `hotfix-X`
- [ ] Update version number within the repository
- in `setup.py`
- in Copyright Notice in `README`
- in the `LICENSE`
- [ ] Update classifiers in `setup.py`
- [ ] Verify that all tests pass (`python setup.py test`)
- [ ] Branch off of `main` and name the branch `release-X.X.X` or `hotfix-X` or `vX.X.X`
- [ ] Update version number within the repository with `bump2version`
- [ ] Commit the changes, push to GitHub, and start a pull request into `main`
- [ ] Approve PR, merge it into `main`, and delete release or hotfix branch
- [ ] Create tagged version (`X.X.X`) on [GitHub](https://github.com/lbl-anp/becquerel/releases/new) pointing to the merge commit to `main`
- [ ] Once PR approved, merge it into `main`, and delete release branch.
- [ ] Create tagged version (`vX.X.X`) on [GitHub](https://github.com/lbl-anp/becquerel/releases/new) pointing to the merge commit to `main`
- [ ] Add release notes to the tag on GitHub with a list of changes

## 2. Distribution Creation/Upload

- [ ] Create distribution
```bash
git pull
git checkout X.X.X
rm dist/*
python3 -m pip install --user --upgrade setuptools wheel
python3 setup.py sdist bdist_wheel --universal
```
- [ ] Test distribution
```bash
python3 -m pip install dist/becquerel-X.X.X-py2.py3-none-any.whl
python3 -m pip install dist/becquerel-X.X.X.tar.gz
```
- [ ] Upload new version to PyPI
```bash
python3 -m pip install --user --upgrade twine
python3 -m twine upload dist/*
```
- [ ] Test new version installs from PyPI
```bash
cd ..
python3 -m pip install becquerel
python3 -c "import becquerel; print(becquerel.__version__)"
```
Once the release is submitted and `main` is tagged, github actions will automatically deploy to `pypi`.
2 changes: 1 addition & 1 deletion becquerel/__metadata__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
__email__ = "[email protected]"
__description__ = "Tools for radiation spectral analysis."
__url__ = "https://github.com/lbl-anp/becquerel"
__version__ = "0.4.1"
__version__ = "0.4.2"
# classifiers from list at https://pypi.org/classifiers/
__classifiers__ = [
"Development Status :: 4 - Beta",
Expand Down
6 changes: 3 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.4.1
current_version = 0.4.2
commit = True
tag = False

Expand All @@ -8,10 +8,10 @@ test = pytest

[tool:pytest]
addopts = --black --cov=becquerel --cov-report term --cov-report html:htmlcov -m "not plottest"
markers =
markers =
webtest: test requires internet connection
plottest: test will produce plot figures
filterwarnings =
filterwarnings =
always
ignore:.*t resolve package from __spec__ or __package__.*:ImportWarning

Expand Down
2 changes: 1 addition & 1 deletion tests/samples/1110C NAA cave background May 2017.spe
Original file line number Diff line number Diff line change
Expand Up @@ -16408,7 +16408,7 @@ $ENER_FIT:
-0.035087 0.182804
$MCA_CAL:
3
-3.508700E-002 1.828039E-001 -6.866130E-010
-3.508700E-002 1.828039E-001 -6.866130E-010
$SHAPE_CAL:
3
4.714864E+000 1.056482E-003 -2.506160E-008
2 changes: 1 addition & 1 deletion tests/samples/1110C NAA cave pottery.Spe
Original file line number Diff line number Diff line change
Expand Up @@ -16419,7 +16419,7 @@ $ENER_FIT:
-0.035087 0.182804
$MCA_CAL:
3
-3.508700E-002 1.828039E-001 -6.866130E-010
-3.508700E-002 1.828039E-001 -6.866130E-010
$SHAPE_CAL:
3
4.714864E+000 1.056482E-003 -2.506160E-008
2 changes: 1 addition & 1 deletion tests/samples/digibase_5min_30_1.spe
Original file line number Diff line number Diff line change
Expand Up @@ -1044,7 +1044,7 @@ $ENER_FIT:
0.000000 0.000000
$MCA_CAL:
3
0.000000E+000 0.000000E+000 0.000000E+000
0.000000E+000 0.000000E+000 0.000000E+000
$SHAPE_CAL:
3
0.000000E+000 0.000000E+000 0.000000E+000
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
$SPEC_ID:
Sample title.
Sample title.

$MEAS_TIM:
841.42000 849.51000
Expand Down

0 comments on commit eb16033

Please sign in to comment.