Skip to content

MAINT switch CI to use pixi #1098

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 32 commits into from
Oct 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 5 additions & 14 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,21 +1,12 @@
# Configuration for coverage.py

[run]
branch = True
source = imblearn
include = */imblearn/*
omit =
*/setup.py

[report]
exclude_lines =
pragma: no cover
def __repr__
if self.debug:
if settings.DEBUG
raise AssertionError
pragma: no cover
raise NotImplementedError
if 0:
if __name__ == .__main__.:
if self.verbose:
show_missing = True
ignore_errors = True
omit =
*/tests/*
**/setup.py
8 changes: 0 additions & 8 deletions .flake8

This file was deleted.

2 changes: 0 additions & 2 deletions .github/ISSUE_TEMPLATE/other--blank-template-.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,3 @@ labels: ''
assignees: ''

---


68 changes: 68 additions & 0 deletions .github/check-changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Check Changelog
# This check makes sure that the changelog is properly updated
# when a PR introduces a change in a test file.
# To bypass this check, label the PR with "No Changelog Needed".
on:
pull_request:
types: [opened, edited, labeled, unlabeled, synchronize]

jobs:
check:
name: A reviewer will let you know if it is required or can be bypassed
runs-on: ubuntu-latest
if: ${{ contains(github.event.pull_request.labels.*.name, 'No Changelog Needed') == 0 }}
steps:
- name: Get PR number and milestone
run: |
echo "PR_NUMBER=${{ github.event.pull_request.number }}" >> $GITHUB_ENV
echo "TAGGED_MILESTONE=${{ github.event.pull_request.milestone.title }}" >> $GITHUB_ENV
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: Check the changelog entry
run: |
set -xe
changed_files=$(git diff --name-only origin/main)
# Changelog should be updated only if tests have been modified
if [[ ! "$changed_files" =~ tests ]]
then
exit 0
fi
all_changelogs=$(cat ./doc/whats_new/v*.rst)
if [[ "$all_changelogs" =~ :pr:\`$PR_NUMBER\` ]]
then
echo "Changelog has been updated."
# If the pull request is milestoned check the correspondent changelog
if exist -f ./doc/whats_new/v${TAGGED_MILESTONE:0:4}.rst
then
expected_changelog=$(cat ./doc/whats_new/v${TAGGED_MILESTONE:0:4}.rst)
if [[ "$expected_changelog" =~ :pr:\`$PR_NUMBER\` ]]
then
echo "Changelog and milestone correspond."
else
echo "Changelog and milestone do not correspond."
echo "If you see this error make sure that the tagged milestone for the PR"
echo "and the edited changelog filename properly match."
exit 1
fi
fi
else
echo "A Changelog entry is missing."
echo ""
echo "Please add an entry to the changelog at 'doc/whats_new/v*.rst'"
echo "to document your change assuming that the PR will be merged"
echo "in time for the next release of imbalanced-learn."
echo ""
echo "Look at other entries in that file for inspiration and please"
echo "reference this pull request using the ':pr:' directive and"
echo "credit yourself (and other contributors if applicable) with"
echo "the ':user:' directive."
echo ""
echo "If you see this error and there is already a changelog entry,"
echo "check that the PR number is correct."
echo ""
echo "If you believe that this PR does not warrant a changelog"
echo "entry, say so in a comment so that a maintainer will label"
echo "the PR with 'No Changelog Needed' to bypass this check."
exit 1
fi
18 changes: 18 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: 2
updates:
# Maintain dependencies for GitHub Actions as recommended in SPEC8:
# https://github.com/scientific-python/specs/pull/325
# At the time of writing, release critical workflows such as
# pypa/gh-action-pypi-publish should use hash-based versioning for security
# reasons. This strategy may be generalized to all other github actions
# in the future.
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
groups:
actions:
patterns:
- "*"
reviewers:
- "glemaitre"
19 changes: 15 additions & 4 deletions .github/workflows/circleci-artifacts-redirector.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
name: circleci-artifacts-redirector
name: CircleCI artifacts redirector

on: [status]

# Restrict the permissions granted to the use of secrets.GITHUB_TOKEN in this
# github actions workflow:
# https://docs.github.com/en/actions/security-guides/automatic-token-authentication
permissions:
statuses: write

jobs:
circleci_artifacts_redirector_job:
runs-on: ubuntu-latest
# For testing this action on a fork, remove the "github.repository =="" condition.
if: "github.repository == 'scikit-learn-contrib/imbalanced-learn' && github.event.context == 'ci/circleci: doc'"
name: Run CircleCI artifacts redirector
steps:
- name: GitHub Action step
uses: larsoner/circleci-artifacts-redirector-action@master
uses: scientific-python/circleci-artifacts-redirector-action@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
artifact-path: doc/index.html
circleci-jobs: documentation
api-token: ${{ secrets.CIRCLE_CI }}
artifact-path: 0/doc/index.html
circleci-jobs: doc
job-title: Check the rendered docs here!
24 changes: 24 additions & 0 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Run code format checks

on:
push:
branches:
- "main"
pull_request:
branches:
- '*'

jobs:
run-pre-commit-checks:
name: Run pre-commit checks
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: prefix-dev/setup-pixi@v0.8.1
with:
pixi-version: v0.31.0
frozen: true

- name: Run tests
run: pixi run -e linters linters
55 changes: 55 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: 'tests'

on:
push:
branches:
- "main"
pull_request:
branches:
- '*'

jobs:
test:
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
environment: [
ci-py310-min-dependencies,
ci-py310-min-optional-dependencies,
ci-py310-min-keras,
ci-py310-min-tensorflow,
ci-py311-sklearn-1-3,
ci-py311-sklearn-1-4,
ci-py311-latest-keras,
ci-py311-latest-tensorflow,
ci-py312-latest-dependencies,
ci-py312-latest-optional-dependencies,
]
exclude:
- os: windows-latest
environment: ci-py310-min-keras
- os: windows-latest
environment: ci-py310-min-tensorflow
- os: windows-latest
environment: ci-py311-latest-keras
- os: windows-latest
environment: ci-py311-latest-tensorflow
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: prefix-dev/setup-pixi@v0.8.1
with:
pixi-version: v0.31.0
environments: ${{ matrix.environment }}
# we can freeze the environment and manually bump the dependencies to the
# latest version time to time.
frozen: true

- name: Run tests
run: pixi run -e ${{ matrix.environment }} tests -n 3

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4.5.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: scikit-learn-contrib/imbalanced-learn
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,10 @@ doc/min_dependency_table.rst

# MacOS
.DS_Store

# Pixi folder
.pixi/

# Generated files
doc/min_dependency_substitutions.rst
doc/sg_execution_times.rst
16 changes: 5 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,13 @@ repos:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.0.272
rev: v0.4.8
hooks:
- id: ruff
args: ["--fix", "--show-source"]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.3.0
args: ["--fix", "--output-format=full"]
- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: mypy
files: imblearn/
additional_dependencies: [pytest==6.2.4]
- id: black
35 changes: 0 additions & 35 deletions Makefile

This file was deleted.

20 changes: 10 additions & 10 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@
.. |Black| image:: https://img.shields.io/badge/code%20style-black-000000.svg
.. _Black: :target: https://github.com/psf/black

.. |PythonMinVersion| replace:: 3.8
.. |NumPyMinVersion| replace:: 1.17.3
.. |SciPyMinVersion| replace:: 1.5.0
.. |ScikitLearnMinVersion| replace:: 1.0.2
.. |MatplotlibMinVersion| replace:: 3.1.2
.. |PandasMinVersion| replace:: 1.0.5
.. |TensorflowMinVersion| replace:: 2.4.3
.. |KerasMinVersion| replace:: 2.4.3
.. |SeabornMinVersion| replace:: 0.9.0
.. |PytestMinVersion| replace:: 5.0.1
.. |PythonMinVersion| replace:: 3.10
.. |NumPyMinVersion| replace:: 1.24.3
.. |SciPyMinVersion| replace:: 1.10.1
.. |ScikitLearnMinVersion| replace:: 1.2.2
.. |MatplotlibMinVersion| replace:: 3.7.3
.. |PandasMinVersion| replace:: 1.5.3
.. |TensorflowMinVersion| replace:: 2.13.1
.. |KerasMinVersion| replace:: 3.0.5
.. |SeabornMinVersion| replace:: 0.12.2
.. |PytestMinVersion| replace:: 7.2.2

imbalanced-learn
================
Expand Down
Loading
Loading