Skip to content

Commit 30b0be7

Browse files
authored
Refactoring, use black (#37)
* refactoring * black * continue * check * fix style * ignore * rst
1 parent 12609dc commit 30b0be7

File tree

125 files changed

+7651
-5991
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+7651
-5991
lines changed

.circleci/config.yml

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,36 +17,36 @@ jobs:
1717
- run:
1818
name: Install dependencies for graphviz
1919
command: |
20-
sudo apt update
21-
sudo apt-get install -y graphviz sqlite3 libtiff-dev libsqlite3-dev
20+
sudo apt update
21+
sudo apt-get install -y graphviz sqlite3 libtiff-dev libsqlite3-dev
2222
2323
- run:
2424
name: Install dependencies for proj
2525
command: |
26-
sudo apt-get install -y libgeos-dev proj-data
26+
sudo apt-get install -y libgeos-dev proj-data
2727
2828
- run:
2929
name: build proj
3030
command: |
31-
# see https://stackoverflow.com/questions/72442087/cant-install-proj-8-0-0-for-cartopy-linux
32-
wget https://download.osgeo.org/proj/proj-9.0.0.tar.gz
33-
tar -xf proj-9.0.0.tar.gz
34-
cd proj-9.0.0
35-
mkdir build && cd build
36-
cmake ..
37-
cmake --build .
38-
sudo cmake --build . --target install
39-
cd ..
31+
# see https://stackoverflow.com/questions/72442087/cant-install-proj-8-0-0-for-cartopy-linux
32+
wget https://download.osgeo.org/proj/proj-9.0.0.tar.gz
33+
tar -xf proj-9.0.0.tar.gz
34+
cd proj-9.0.0
35+
mkdir build && cd build
36+
cmake ..
37+
cmake --build .
38+
sudo cmake --build . --target install
39+
cd ..
4040
4141
- run:
4242
name: install ldconfig
4343
command: |
44-
sudo ldconfig
44+
sudo ldconfig
4545
4646
- run:
4747
name: install dependencies
4848
command: |
49-
pip install -r requirements.txt
49+
pip install -r requirements.txt
5050
5151
- save_cache:
5252
paths:
@@ -56,22 +56,20 @@ jobs:
5656
- run:
5757
name: check list of dependencies
5858
command: |
59-
pip freeze
60-
apt list --installed
59+
pip freeze
60+
apt list --installed
6161
6262
- run:
6363
name: run tests
6464
command: |
65-
export PYTHONPATH=src
66-
python setup.py unittests -d 20
65+
python setup.py unittests -d 20
6766
6867
- run:
6968
name: wheel
7069
command: |
71-
export PYTHONPATH=src
72-
python ./setup.py bdist_wheel
73-
mkdir -p test-reports/dist
74-
cp dist/*.whl test-reports/dist
70+
python ./setup.py bdist_wheel
71+
mkdir -p test-reports/dist
72+
cp dist/*.whl test-reports/dist
7573
7674
- store_artifacts:
7775
path: test-reports

.gitattributes

Lines changed: 0 additions & 22 deletions
This file was deleted.

.github/workflows/black.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: Black Format Checker
2+
on: [push, pull_request]
3+
jobs:
4+
black-format-check:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v2
8+
- uses: psf/black@stable
9+
with:
10+
options: "--diff --check"
11+
src: "."

.github/workflows/codeql.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: "Code Scanning - Action"
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
schedule:
9+
# ┌───────────── minute (0 - 59)
10+
# │ ┌───────────── hour (0 - 23)
11+
# │ │ ┌───────────── day of the month (1 - 31)
12+
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
13+
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
14+
# │ │ │ │ │
15+
# │ │ │ │ │
16+
# │ │ │ │ │
17+
# * * * * *
18+
- cron: '30 1 * * 0'
19+
20+
jobs:
21+
CodeQL-Build:
22+
# CodeQL runs on ubuntu-latest, windows-latest, and macos-latest
23+
runs-on: ubuntu-latest
24+
25+
permissions:
26+
# required for all workflows
27+
security-events: write
28+
29+
# only required for workflows in private repositories
30+
actions: read
31+
contents: read
32+
33+
steps:
34+
- name: Checkout repository
35+
uses: actions/checkout@v3
36+
37+
# Initializes the CodeQL tools for scanning.
38+
- name: Initialize CodeQL
39+
uses: github/codeql-action/init@v2
40+
# Override language selection by uncommenting this and choosing your languages
41+
# with:
42+
# languages: go, javascript, csharp, python, cpp, java, ruby
43+
44+
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
45+
# If this step fails, then you should remove it and run the build manually (see below).
46+
- name: Autobuild
47+
uses: github/codeql-action/autobuild@v2
48+
49+
# ℹ️ Command-line programs to run using the OS shell.
50+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
51+
52+
# ✏️ If the Autobuild fails above, remove it and uncomment the following
53+
# three lines and modify them (or add more) to build your code if your
54+
# project uses a compiled language
55+
56+
#- run: |
57+
# make bootstrap
58+
# make release
59+
60+
- name: Perform CodeQL Analysis
61+
uses: github/codeql-action/analyze@v2

.github/workflows/documentation.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Documentation
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
schedule:
9+
# ┌───────────── minute (0 - 59)
10+
# │ ┌───────────── hour (0 - 23)
11+
# │ │ ┌───────────── day of the month (1 - 31)
12+
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
13+
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
14+
# │ │ │ │ │
15+
# │ │ │ │ │
16+
# │ │ │ │ │
17+
# * * * * *
18+
- cron: '30 1 * * 0'
19+
20+
jobs:
21+
build_wheels:
22+
name: Build documentation on ${{ matrix.os }}
23+
runs-on: ${{ matrix.os }}
24+
strategy:
25+
matrix:
26+
os: [ubuntu-latest]
27+
28+
steps:
29+
- uses: actions/checkout@v3
30+
31+
# Used to host cibuildwheel
32+
- uses: actions/setup-python@v4
33+
with:
34+
python-version: '3.11'
35+
36+
- name: Install requirements
37+
run: python -m pip install -r requirements.txt
38+
39+
- name: Install requirements-dev.txt
40+
run: python -m pip install -r requirements-dev.txt
41+
42+
- name: Install
43+
run: python -m pip install -e .
44+
45+
- name: Documentation
46+
run: python -m sphinx ./_doc ./dist/html
47+
48+
- uses: actions/upload-artifact@v3
49+
with:
50+
path: ./dist/html/**

.github/workflows/rstcheck.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: RST Check
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build_wheels:
7+
name: rstcheck ${{ matrix.os }}
8+
runs-on: ${{ matrix.os }}
9+
strategy:
10+
matrix:
11+
os: [ubuntu-latest]
12+
13+
steps:
14+
- uses: actions/checkout@v3
15+
16+
# Used to host cibuildwheel
17+
- uses: actions/setup-python@v4
18+
with:
19+
python-version: '3.11'
20+
21+
- name: Install requirements
22+
run: python -m pip install -r requirements.txt
23+
24+
- name: Install rstcheck
25+
run: python -m pip install sphinx tomli rstcheck[toml,sphinx]
26+
27+
- name: rstcheck
28+
run: rstcheck -r _doc mlstatpy

.github/workflows/wheels-linux.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Build Wheel Linux
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- 'releases/**'
8+
9+
jobs:
10+
build_wheels:
11+
name: Build wheels on ${{ matrix.os }}
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
matrix:
15+
os: [ubuntu-latest]
16+
17+
steps:
18+
- uses: actions/checkout@v3
19+
20+
# Used to host cibuildwheel
21+
- uses: actions/setup-python@v4
22+
with:
23+
python-version: '3.11'
24+
25+
- name: Install cibuildwheel
26+
run: python -m pip install cibuildwheel
27+
28+
- name: python version
29+
run: python -V
30+
31+
- name: Build wheels
32+
run: python -m cibuildwheel --output-dir wheelhouse
33+
# to supply options, put them in 'env', like:
34+
#env:
35+
# # CIBW_BUILD: "cp310* cp311*"
36+
# CIBW_SKIP: cp36-* cp37-* cp38-* cp39-*
37+
38+
- uses: actions/upload-artifact@v3
39+
with:
40+
path: ./wheelhouse/*.whl

.github/workflows/wheels-mac.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Build Wheel MacOS
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- 'releases/**'
8+
9+
jobs:
10+
build_wheels:
11+
name: Build wheels on ${{ matrix.os }}
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
matrix:
15+
os: [macOS-latest]
16+
17+
steps:
18+
- uses: actions/checkout@v3
19+
20+
# Used to host cibuildwheel
21+
- uses: actions/setup-python@v4
22+
with:
23+
python-version: '3.11'
24+
25+
- name: Install cibuildwheel
26+
run: python -m pip install cibuildwheel
27+
28+
- name: python version
29+
run: python -V
30+
31+
- name: Build wheels
32+
run: python -m cibuildwheel --output-dir wheelhouse
33+
# to supply options, put them in 'env', like:
34+
#env:
35+
# CIBW_BUILD: cp311*
36+
37+
- uses: actions/upload-artifact@v3
38+
with:
39+
path: ./wheelhouse/*.whl

.github/workflows/wheels-windows.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Build Wheel Windows
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- 'releases/**'
8+
9+
jobs:
10+
build_wheels:
11+
name: Build wheels on ${{ matrix.os }}
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
matrix:
15+
os: [windows-latest]
16+
17+
steps:
18+
- uses: actions/checkout@v3
19+
20+
# Used to host cibuildwheel
21+
- uses: actions/setup-python@v4
22+
with:
23+
python-version: '3.11'
24+
25+
- name: Install cibuildwheel
26+
run: python -m pip install cibuildwheel
27+
28+
- name: python version
29+
run: python -V
30+
31+
- name: Build wheels
32+
run: python -m cibuildwheel
33+
# to supply options, put them in 'env', like:
34+
# env:
35+
# CIBW_BUILD: cp310-win_amd64* cp311-win_amd64*
36+
37+
- uses: actions/upload-artifact@v3
38+
with:
39+
path: ./wheelhouse/*.whl

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,5 +278,10 @@ _doc/sphinxdoc/source/c_ml/*.html
278278
_unittests/ut_graph/*.prof
279279
_doc/notebooks/ml/onnxruntime*.json
280280
_doc/notebooks/ml/tree_*.onnx
281+
_doc/sphinxdoc/source/HISTORY.rst
282+
_doc/sphinxdoc/source/README.rst
283+
_doc/sphinxdoc/source/_static/embed-amd.js
284+
_doc/sphinxdoc/source/_static/style_notebook_snippet.css
285+
_doc/sphinxdoc/source/_temp_*
281286
*.out
282287
*.err

0 commit comments

Comments
 (0)