Skip to content
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

build: use PEP517/518 conventions #100

Merged
merged 80 commits into from
Jan 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
c3276b4
chore: clean useless comments
deepcharles Dec 29, 2020
a018c4c
style: sort imports
deepcharles Jan 2, 2021
eac0d97
test: add __init__.py to collect coverage
deepcharles Jan 2, 2021
dc75a26
build: adopt PEP 517/518 for setup.py
deepcharles Jan 2, 2021
f59ceb8
build: adopt PEP 517/518 for pyproject.toml
deepcharles Jan 2, 2021
1abd0ae
test: add pytest-cov options in pyproject.toml
deepcharles Jan 2, 2021
1d4b1b6
ci: clean upload-to-pypi gh action
deepcharles Jan 2, 2021
4a517f2
ci: clean check-docs gh action
deepcharles Jan 2, 2021
68a1e9f
ci: clean check-linting gh action
deepcharles Jan 2, 2021
9c15492
ci: clean publish-doc-to-remote gh action
deepcharles Jan 2, 2021
1ec438e
ci: clean run-coverage gh action
deepcharles Jan 2, 2021
135b502
ci: clean run-tests gh action
deepcharles Jan 2, 2021
cf15017
style: remove useless imports
deepcharles Jan 2, 2021
afa2c91
style: remove useless comments
deepcharles Jan 2, 2021
c4f89f4
build: bump version (dev)
deepcharles Jan 2, 2021
61ffa7e
chore: clean useless comments
deepcharles Dec 29, 2020
6c29374
style: sort imports
deepcharles Jan 2, 2021
518d1f0
test: add __init__.py to collect coverage
deepcharles Jan 2, 2021
4b41a22
build: adopt PEP 517/518 for setup.py
deepcharles Jan 2, 2021
aa9bf33
build: adopt PEP 517/518 for pyproject.toml
deepcharles Jan 2, 2021
83f48e8
test: add pytest-cov options in pyproject.toml
deepcharles Jan 2, 2021
2280980
ci: clean upload-to-pypi gh action
deepcharles Jan 2, 2021
0f15fb6
ci: clean check-docs gh action
deepcharles Jan 2, 2021
eb94f7e
ci: clean check-linting gh action
deepcharles Jan 2, 2021
a076817
ci: clean publish-doc-to-remote gh action
deepcharles Jan 2, 2021
45cd32c
ci: clean run-coverage gh action
deepcharles Jan 2, 2021
79efc0d
ci: clean run-tests gh action
deepcharles Jan 2, 2021
cf77355
style: remove useless imports
deepcharles Jan 2, 2021
3cb5153
style: remove useless comments
deepcharles Jan 2, 2021
51f5914
build: bump version (dev)
deepcharles Jan 2, 2021
daec5c2
Merge branch 'better-setup' of https://github.com/deepcharles/rupture…
deepcharles Jan 2, 2021
7bf0d94
test: fix py-coverage options
deepcharles Jan 2, 2021
e92ccf6
chore: clean useless file
deepcharles Jan 2, 2021
e2110f2
ci: correct circleci job
deepcharles Jan 2, 2021
af8bd7f
style: sort imports
deepcharles Jan 2, 2021
5713286
style: sort imports
deepcharles Jan 2, 2021
d9c5002
ci: fix typo
deepcharles Jan 2, 2021
3162fe3
ci: fix typo
deepcharles Jan 2, 2021
c9bc9e9
ci: add verbose when installing ruptures
deepcharles Jan 2, 2021
8e53535
build: update MANIFEST.in
deepcharles Jan 2, 2021
7a5dd86
build: remove one level of verbose
deepcharles Jan 2, 2021
710d80a
build: remove one level of verbose
deepcharles Jan 2, 2021
2ec5081
build: fix typo in MANIFEST.in
deepcharles Jan 2, 2021
a7bf217
build: add test import
deepcharles Jan 2, 2021
0a4657e
fix: relative import
deepcharles Jan 2, 2021
3fc4910
fix: relative import
deepcharles Jan 2, 2021
4f5eb23
fix: relative import
deepcharles Jan 2, 2021
2a8a72f
fix: relative import
deepcharles Jan 2, 2021
deff40c
build: remove verbose
deepcharles Jan 2, 2021
51ca05d
fix: relative import
deepcharles Jan 2, 2021
efd6e88
fix: relative import
deepcharles Jan 2, 2021
e4a5618
chore: test sys.path
deepcharles Jan 2, 2021
b848c39
style: clean debug commands
deepcharles Jan 3, 2021
8ad8f5c
build: fix find_packages
deepcharles Jan 3, 2021
8d50ca6
style: cleaner setup.py
deepcharles Jan 3, 2021
3b7ebba
ci: print find_packages (debug)
deepcharles Jan 3, 2021
a5ef228
ci: print find_packages (debug)
deepcharles Jan 3, 2021
889e134
build: old-fashioned find_packages
deepcharles Jan 3, 2021
a6bb2cc
fix: try different import
deepcharles Jan 3, 2021
753df98
build: change layout (use src folder) in setup.cfg
deepcharles Jan 3, 2021
1d472ba
build: change layout (put package in src/)
deepcharles Jan 3, 2021
ccfe94a
test: cleaner gh action for tests
deepcharles Jan 3, 2021
3342ec0
ci: cleaner install in coverage gh action
deepcharles Jan 3, 2021
51bf186
ci: update covered folder in test coverage
deepcharles Jan 3, 2021
a341809
ci: add pytest-cov to ruptures[test] flavour
deepcharles Jan 3, 2021
4207844
ci: test if pytest-cov is installed
deepcharles Jan 3, 2021
d3b18ea
style: renaming step in gh action
deepcharles Jan 3, 2021
3856879
ci: change arg to collect coverage
deepcharles Jan 3, 2021
ffb3c18
ci: arg to collect coverage
deepcharles Jan 3, 2021
8740008
ci: change pytest-cov argument
deepcharles Jan 3, 2021
81a915e
chore: delete useless files
deepcharles Jan 4, 2021
c92fe3f
style: clean debug statement
deepcharles Jan 4, 2021
e2ebb55
style: clean useless statements in MANIFEST.IN
deepcharles Jan 4, 2021
954d0ec
style: clean .gitignore
deepcharles Jan 4, 2021
07530f6
docs: update CONTRIBUTING.md
deepcharles Jan 4, 2021
1b9a33a
chore: revert .flake8 deletion
deepcharles Jan 4, 2021
24422e9
chore: set the version back to current production version
oboulant Jan 4, 2021
0dd496b
ci: Removing CircleCI
oboulant Jan 4, 2021
e60f584
refactor: removing some dependencies
oboulant Jan 4, 2021
262a694
fix: typo
oboulant Jan 4, 2021
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
61 changes: 0 additions & 61 deletions .circleci/config.yml

This file was deleted.

11 changes: 3 additions & 8 deletions .github/workflows/check-docs.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Pull Request Docs Check"
name: "Check docs"
on:
- pull_request

Expand All @@ -7,19 +7,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.x
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
# Semantic version range syntax or exact version of a Python version
python-version: '3.8'
# You can test your matrix by printing the current Python version
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Install ruptures and dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi
python setup.py install
python -m pip install .[dev]
- name: Run notebooks
run: |
jupyter nbconvert --inplace --to notebook --ExecutePreprocessor.kernel_name=python --execute $(find ./docs -name '*.ipynb')
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/check-linting.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: check-linting
name: Check linting

on:
push:
Expand All @@ -18,7 +18,7 @@ jobs:
- name: Install pre-commit hooks
run: |
python -m pip install --upgrade pip
pip install pre-commit
python -m pip install pre-commit
- name: Run pre-commit hooks
run: |
pre-commit run --all-files
13 changes: 4 additions & 9 deletions .github/workflows/publish-doc-to-remote.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Publish doc to website on new release (or manual trigger)
name: "docs"
# Publish docs to website on new release (or manual trigger)
name: "Publish docs online"

on:
release:
Expand All @@ -14,23 +14,18 @@ jobs:
- name: Set up Python 3.x
uses: actions/setup-python@v2
with:
# Semantic version range syntax or exact version of a Python version
python-version: '3.8'
# You can test your matrix by printing the current Python version
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Install ruptures and dependecies
run: |
python -m pip install --upgrade pip
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi
python setup.py install
python -m pip install .[dev]
- name: Run notebooks
run: |
jupyter nbconvert --inplace --to notebook --ExecutePreprocessor.kernel_name=python --execute $(find ./docs -name '*.ipynb')
- name: Build documentation
run: |
mkdocs build
- name: Publish documentation to remote
- name: Publish documentation to remote repo
uses: selenehyun/gh-push@master
env:
GITHUB_TOKEN: ${{ secrets.DOC_PUSHER_ACCESS_TOKEN }}
Expand Down
22 changes: 9 additions & 13 deletions .github/workflows/run-test-coverage.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# This workflow will install Python dependencies, run tests, generate coverage report and upload it to codecov
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
# This workflow will install Python dependencies, run tests, generate coverage
# report and upload it to codecov.
# For more information, see:
# https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: coverage
name: Run tests with coverage

on:
push:
Expand All @@ -14,26 +16,20 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.x
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
pip install pytest-cov
- name: Install ruptures
run: |
python setup.py install
python -m pip install --upgrade pip
python -m pip install .[test]
- name: Test with pytest
run: |
pytest --cov-report=xml --cov=ruptures tests/

python -m pytest
- name: Upload to Codecov
run: |
bash <(curl -s https://codecov.io/bash)

- uses: actions/upload-artifact@v2
with:
path: coverage.xml
13 changes: 4 additions & 9 deletions .github/workflows/run-test.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: build
name: Run tests

on:
push:
Expand All @@ -18,22 +18,17 @@ jobs:
exclude:
- os: windows-latest
python-version: 3.9

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
- name: Install ruptures
run: |
python setup.py install
python -m pip install --upgrade pip
python -m pip install .[test]
- name: Test with pytest
run: |
pytest
python -m pytest
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish to Pypi (sdist and wheels)
name: Upload package to Pypi

on:
workflow_dispatch:
Expand All @@ -15,7 +15,7 @@ jobs:
bitness: [32, 64]
python: [36, 37, 38, 39]
include:
# Run 32 and 64 bit version in parallel for Linux and Windows
# Run 32 and 64 bits version in parallel for Linux and Windows
- os: windows-latest
bitness: 64
platform_id: win_amd64
Expand Down Expand Up @@ -48,9 +48,7 @@ jobs:
- name: Install cibuildwheel and dependencies
run: |
python -m pip install --upgrade pip
python -m pip install cibuildwheel
pip install -r requirements-dev.txt
pip install setuptools wheel twine
python -m pip install cibuildwheel twine

- name: Build wheels
env:
Expand All @@ -59,7 +57,7 @@ jobs:
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python -m cibuildwheel --output-dir wheelhouse
twine upload wheelhouse/*.whl
python -m twine upload wheelhouse/*.whl

- uses: actions/upload-artifact@v2
with:
Expand All @@ -69,26 +67,21 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.x
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
# Semantic version range syntax or exact version of a Python version
python-version: '3.8'
# You can test your matrix by printing the current Python version
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
pip install setuptools wheel twine
- name: Build
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist
twine upload dist/*.tar.gz
python -m twine upload dist/*.tar.gz
- uses: actions/upload-artifact@v2
with:
path: dist/*.tar.gz
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,4 @@ docs/build/*
.Trashes
ehthumbs.db
Thumbs.db
site/
ruptures/utils/_utils/convert_path_matrix.c
ruptures/detection/_detection/continuous_linear_cpd.c
ruptures/detection/_detection/ekcpd.c
site/
36 changes: 14 additions & 22 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@

In all following steps, it is highly recommended to use a virtual environment.

### Install the requirements

Several packages are needed to compile, format and test the code.
They are listed in `requirements-dev.txt` and can be installed with the following command.

### Install the development version

It is important that you contribute to the latest version of the code.
Expand All @@ -20,33 +15,30 @@ git clone https://github.com/deepcharles/ruptures
cd ruptures
```

Then install the downloaded package.
Then install the downloaded package with `pip`.

```
python -m pip install --verbose --no-build-isolation --editable .
python -m pip install --editable .[dev]
```

#### With pip
```
pip install -r requirements-dev.txt
```
Note that `python -m` can be omitted most of the times, but within virtualenvs, it can prevent certain errors.
Also, in certain terminals (such as zsh), the square brackets must be escaped, e.g. replace `.[dev]` by `.\[dev\]`.

#### With conda
```
conda --file requirements-dev.txt
```

Then run the following command to install the `pre-commit` hooks.
```
pre-commit install
```
In addition to `numpy`, `scipy` and `ruptures`, this command will install all packages needed to develop `ruptures`.
The exact list of librairies can be found in the [`setup.cfg` file](https://github.com/deepcharles/ruptures/blob/master/setup.cfg) (section `[options.extras_require]`).

### Pre-commit hooks

We use `pre-commit` to run Git hooks before submitting the code to review.
These hook scripts perform simple tasks before each commit (code formatting mostly).
To activate the hooks, simply run the following command in your terminal.

```
pre-commit install
```


Note that if you try to commit a non-compliant (i.e. badly formatted) file, `pre-commit` will modify this file and make the commit fail.
If you try to commit a non-compliant (i.e. badly formatted) file, `pre-commit` will modify this file and make the commit fail.
However you need to stage the new changes **yourself** as `pre-commit` will not do that for you (this is by design; see [here](https://github.com/pre-commit/pre-commit/issues/806) or [here](https://github.com/pre-commit/pre-commit/issues/747)).
Fortunately, `pre-commit` outputs useful messages.

Expand All @@ -61,7 +53,7 @@ If you want to manually run all pre-commit hooks on a repository, run `pre-commi
The following command executes the test suite.

```
pytest
python -m pytest
```

### Write docstrings
Expand Down
10 changes: 0 additions & 10 deletions README.rst

This file was deleted.

4 changes: 0 additions & 4 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,6 @@ nav:
- Binseg: code-reference/detection/binseg-reference.md
- BottomUp: code-reference/detection/bottomup-reference.md
- Window: code-reference/detection/window-reference.md
# - GreedyAR: code-reference/detection/greedyar-reference.md
# - GreedyLinear: code-reference/detection/greedylinear-reference.md
# - Omp: code-reference/detection/omp-reference.md
# - OmpK: code-reference/detection/ompk-reference.md
- Cost functions:
- 'CostL1': code-reference/costs/costl1-reference.md
- 'CostL2': code-reference/costs/costl2-reference.md
Expand Down
Loading