Skip to content

Commit

Permalink
make release-tag: Merge branch 'main' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
amontanez24 committed Apr 11, 2024
2 parents 04d12d9 + 1636a94 commit 786d855
Show file tree
Hide file tree
Showing 28 changed files with 826 additions and 469 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/dependency_checker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Dependency Checker
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * 1-5'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install .[dev]
make check-deps OUTPUT_FILEPATH=latest_requirements.txt
- name: Create pull request
id: cpr
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GH_ACCESS_TOKEN }}
commit-message: Update latest dependencies
title: Automated Latest Dependency Updates
body: "This is an auto-generated PR with **latest** dependency updates."
branch: latest-dependency-update
branch-suffix: short-commit-hash
base: main
2 changes: 1 addition & 1 deletion .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/minimum.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v1
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/readme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
os: [ubuntu-latest, macos-latest] # skip windows bc rundoc fails
steps:
- uses: actions/checkout@v1
Expand All @@ -22,5 +22,7 @@ jobs:
run: |
python -m pip install --upgrade pip
python -m pip install invoke rundoc .
python -m pip install tomli
python -m pip install packaging
- name: Run the README.md
run: invoke readme
33 changes: 33 additions & 0 deletions .github/workflows/static_code_analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Static Code Analysis

on:
release:
types: [published]
workflow_dispatch:

jobs:
code-analysis:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install bandit==1.7.7
- name: Save code analysis
run: bandit -r . -x ./tests -f txt -o static_code_analysis.txt --exit-zero
- name: Create pull request
id: cpr
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GH_ACCESS_TOKEN }}
commit-message: Update static code analysis
title: Latest Code Analysis
body: "This is an auto-generated PR with the **latest** code analysis results."
branch: static-code-analysis
branch-suffix: short-commit-hash
base: main
2 changes: 1 addition & 1 deletion .github/workflows/unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v1
Expand Down
10 changes: 5 additions & 5 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -174,17 +174,17 @@ Release Workflow
The process of releasing a new version involves several steps combining both ``git`` and
``bumpversion`` which, briefly:

1. Merge what is in ``master`` branch into ``stable`` branch.
1. Merge what is in ``main`` branch into ``stable`` branch.
2. Update the version in ``setup.cfg``, ``deepecho/__init__.py`` and
``HISTORY.md`` files.
3. Create a new git tag pointing at the corresponding commit in ``stable`` branch.
4. Merge the new commit from ``stable`` into ``master``.
4. Merge the new commit from ``stable`` into ``main``.
5. Update the version in ``setup.cfg`` and ``deepecho/__init__.py``
to open the next development iteration.

.. note:: Before starting the process, make sure that ``HISTORY.md`` has been updated with a new
entry that explains the changes that will be included in the new version.
Normally this is just a list of the Pull Requests that have been merged to master
Normally this is just a list of the Pull Requests that have been merged to main
since the last release.

Once this is done, run of the following commands:
Expand Down Expand Up @@ -219,9 +219,9 @@ This will perform the following actions:
2. Bump the current version to the next release candidate, ``X.Y.Z.dev(N+1)``

After this is done, the new pre-release can be installed by including the ``dev`` section in the
dependency specification, either in ``setup.py``::
dependency specification, either in ``pyproject.toml``::

install_requires = [
dependencies = [
...
'deepecho>=X.Y.Z.dev',
...
Expand Down
25 changes: 25 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
# History

## 0.6.0 - 2024-04-10

This release adds support for Python 3.12!

### Maintenance

* Support Python 3.12 - Issue [#85](https://github.com/sdv-dev/DeepEcho/issues/85) by @fealho
* Transition from using setup.py to pyproject.toml to specify project metadata - Issue [#86](https://github.com/sdv-dev/DeepEcho/issues/86) by @R-Palazzo
* Remove bumpversion and use bump-my-version - Issue [#87](https://github.com/sdv-dev/DeepEcho/issues/87) by @R-Palazzo
* Add dependency checker - Issue [#96](https://github.com/sdv-dev/DeepEcho/issues/96) by @lajohn4747
* Add bandit workflow - Issue [#98](https://github.com/sdv-dev/DeepEcho/issues/98) by @R-Palazzo

### Bugs Fixed

* Fix make check candidate - Issue [#91](https://github.com/sdv-dev/DeepEcho/issues/91) by @R-Palazzo
* Fix minimum version workflow when pointing to github branch - Issue [#99](https://github.com/sdv-dev/DeepEcho/issues/99) by @R-Palazzo

## 0.5.0 - 2023-11-13

This release updates the PAR's model progress bar to show loss values and time elapsed (verbose option).

### New Features
* Update progress bar for PAR fitting - Issue [#80](https://github.com/sdv-dev/DeepEcho/issues/80) by @frances-h


## 0.4.2 - 2023-07-25

This release drops support for Python 3.7 and adds support for Python 3.11.
Expand Down
6 changes: 3 additions & 3 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Requirements

**DeepEcho** has been developed and tested on
[Python 3.8, 3.9, 3.10 and 3.11](https://www.python.org/downloads/)
[Python 3.8, 3.9, 3.10, 3.11 and 3.12](https://www.python.org/downloads/)

Also, although it is not strictly required, the usage of a [virtualenv](
https://virtualenv.pypa.io/en/latest/) is highly recommended in order to avoid
Expand Down Expand Up @@ -47,12 +47,12 @@ make install

If you intend to modify the source code or contribute to the project you will need to
install it from the source using the `make install-develop` command. In this case, we
recommend you to branch from `master` first:
recommend you to branch from `main` first:

```bash
git clone [email protected]:sdv-dev/DeepEcho
cd DeepEcho
git checkout master
git checkout main
git checkout -b <your-branch-name>
make install-develp
```
Expand Down
12 changes: 0 additions & 12 deletions MANIFEST.in

This file was deleted.

75 changes: 33 additions & 42 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -79,30 +79,17 @@ install-develop: clean-build clean-pyc ## install the package in editable mode a

# LINT TARGETS

.PHONY: lint-deepecho
lint-deepecho: ## check style with flake8 and isort
flake8 deepecho
isort -c --recursive deepecho
pylint deepecho --rcfile=setup.cfg

.PHONY: lint-tests
lint-tests: ## check style with flake8 and isort
flake8 --ignore=D tests
isort -c --recursive tests

.PHONY: lint
lint: ## Run all code style checks
invoke lint
lint:
ruff check .
ruff format . --check

.PHONY: fix-lint
fix-lint: ## fix lint issues using autoflake, autopep8, and isort
find deepecho tests -name '*.py' | xargs autoflake --in-place --remove-all-unused-imports --remove-unused-variables
autopep8 --in-place --recursive --aggressive deepecho tests
isort --apply --atomic --recursive deepecho tests

fix-lint:
ruff check --fix .
ruff format .

# TEST TARGETS

.PHONY: test-unit
test-unit: ## run unit tests using pytest
invoke unit
Expand Down Expand Up @@ -145,8 +132,7 @@ coverage: ## check code coverage quickly with the default Python

.PHONY: dist
dist: clean ## builds source and wheel package
python setup.py sdist
python setup.py bdist_wheel
python -m build --wheel --sdist
ls -l dist

.PHONY: publish-confirm
Expand All @@ -165,46 +151,46 @@ publish: dist publish-confirm ## package and upload a release
twine upload dist/*

.PHONY: bumpversion-release
bumpversion-release: ## Merge master to stable and bumpversion release
bumpversion-release: ## Merge main to stable and bumpversion release
git checkout stable || git checkout -b stable
git merge --no-ff master -m"make release-tag: Merge branch 'master' into stable"
bumpversion release
git merge --no-ff main -m"make release-tag: Merge branch 'main' into stable"
bump-my-version bump release
git push --tags origin stable

.PHONY: bumpversion-release-test
bumpversion-release-test: ## Merge master to stable and bumpversion release
bumpversion-release-test: ## Merge main to stable and bumpversion release
git checkout stable || git checkout -b stable
git merge --no-ff master -m"make release-tag: Merge branch 'master' into stable"
bumpversion release --no-tag
git merge --no-ff main -m"make release-tag: Merge branch 'main' into stable"
bump-my-version bump release --no-tag
@echo git push --tags origin stable

.PHONY: bumpversion-patch
bumpversion-patch: ## Merge stable to master and bumpversion patch
git checkout master
bumpversion-patch: ## Merge stable to main and bumpversion patch
git checkout main
git merge stable
bumpversion --no-tag patch
bump-my-version bump patch --no-tag
git push

.PHONY: bumpversion-candidate
bumpversion-candidate: ## Bump the version to the next candidate
bumpversion candidate --no-tag
bump-my-version bump candidate --no-tag

.PHONY: bumpversion-minor
bumpversion-minor: ## Bump the version the next minor skipping the release
bumpversion --no-tag minor
bump-my-version bump minor --no-tag

.PHONY: bumpversion-major
bumpversion-major: ## Bump the version the next major skipping the release
bumpversion --no-tag major
bump-my-version bump major --no-tag

.PHONY: bumpversion-revert
bumpversion-revert: ## Undo a previous bumpversion-release
git checkout master
git checkout main
git branch -D stable

CLEAN_DIR := $(shell git status --short | grep -v ??)
CURRENT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD 2>/dev/null)
CURRENT_VERSION := $(shell grep "^current_version" setup.cfg | grep -o "dev[0-9]*")
CURRENT_VERSION := $(shell grep "^current_version" pyproject.toml | grep -o "dev[0-9]*")
CHANGELOG_LINES := $(shell git diff HEAD..origin/stable HISTORY.md 2>&1 | wc -l)

.PHONY: check-clean
Expand All @@ -213,10 +199,10 @@ ifneq ($(CLEAN_DIR),)
$(error There are uncommitted changes)
endif

.PHONY: check-master
check-master: ## Check if we are in master branch
ifneq ($(CURRENT_BRANCH),master)
$(error Please make the release from master branch\n)
.PHONY: check-main
check-main: ## Check if we are in main branch
ifneq ($(CURRENT_BRANCH),main)
$(error Please make the release from main branch\n)
endif

.PHONY: check-candidate
Expand All @@ -231,8 +217,13 @@ ifeq ($(CHANGELOG_LINES),0)
$(error Please insert the release notes in HISTORY.md before releasing)
endif

.PHONY: check-deps
check-deps: # Dependency targets
$(eval allow_list='numpy=|pandas=|torch=|tqdm=')
pip freeze | grep -v "SDMetrics.git" | grep -E $(allow_list) | sort > $(OUTPUT_FILEPATH)

.PHONY: check-release
check-release: check-clean check-candidate check-master check-history ## Check if the release can be made
check-release: check-clean check-candidate check-main check-history ## Check if the release can be made
@echo "A new release can be made"

.PHONY: release
Expand All @@ -242,7 +233,7 @@ release: check-release bumpversion-release publish bumpversion-patch
release-test: check-release bumpversion-release-test publish-test bumpversion-revert

.PHONY: release-candidate
release-candidate: check-master publish bumpversion-candidate
release-candidate: check-main publish bumpversion-candidate

.PHONY: release-candidate-test
release-candidate-test: check-clean check-master publish-test
release-candidate-test: check-clean check-main publish-test
Loading

0 comments on commit 786d855

Please sign in to comment.