Skip to content

Commit f52220e

Browse files
authored
Change setup to pyproject.toml (#29)
* migrate to pyproject toml * fix lint test * fix docs * change python version tests * remove python 3.8 * fix tests * use 20.04 image of ubuntu * downgrade pip
1 parent 6ab130c commit f52220e

24 files changed

+576
-651
lines changed

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- name: Python
1515
uses: actions/setup-python@v1
1616
with:
17-
python-version: '3.8'
17+
python-version: '3.9'
1818

1919
- name: Build
2020
run: |

.github/workflows/tests.yml

Lines changed: 36 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -11,94 +11,72 @@ on:
1111

1212
jobs:
1313
lint:
14-
runs-on: ${{ matrix.os }}
15-
strategy:
16-
matrix:
17-
python-version: [3.8]
18-
os: [macos-13]
14+
runs-on: ubuntu-20.04
1915
steps:
20-
- uses: actions/checkout@v1
21-
- name: Set up Python ${{ matrix.python-version }}
22-
uses: actions/setup-python@v2
16+
- uses: actions/checkout@v4
17+
- name: Set up Python 3.9
18+
uses: actions/setup-python@v5
2319
with:
24-
python-version: ${{ matrix.python-version }}
25-
- name: Install package
20+
python-version: '3.9'
21+
- name: Install dependencies
2622
run: |
27-
python -m pip install --upgrade pip
28-
python -m pip install invoke .[dev]
29-
- name: invoke lint
23+
pip install --upgrade "pip<=24.1" setuptools wheel
24+
python -m pip install invoke .[dev]
25+
- name: Run lint checks
3026
run: invoke lint
3127

3228

33-
# docs:
34-
# runs-on: ${{ matrix.os }}
35-
# strategy:
36-
# matrix:
37-
# python-version: ['3.8', '3.9', '3.10', '3.11']
38-
# os: [ubuntu-20.04]
39-
# steps:
40-
# - uses: actions/checkout@v1
41-
# - name: Set up Python ${{ matrix.python-version }}
42-
# uses: actions/setup-python@v2
43-
# with:
44-
# python-version: ${{ matrix.python-version }}
45-
# - name: Install package
46-
# run: pip install .[dev]
47-
# - name: make docs
48-
# run: make docs
29+
docs:
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: actions/checkout@v4
33+
- name: Set up Python 3.9
34+
uses: actions/setup-python@v5
35+
with:
36+
python-version: '3.9'
37+
- name: Install dependencies
38+
run: |
39+
python -m pip install --upgrade pip
40+
python -m pip install .[dev]
41+
- name: Build docs
42+
run: make docs
4943

5044

5145
unit:
5246
runs-on: ${{ matrix.os }}
5347
strategy:
5448
matrix:
55-
python-version: ['3.8', '3.9', '3.10', '3.11']
56-
os: [ubuntu-latest, macos-13, windows-latest]
49+
python-version: ['3.9', '3.10', '3.11']
50+
os: [ubuntu-latest, macos-latest, windows-latest]
5751
steps:
58-
- uses: actions/checkout@v1
52+
- uses: actions/checkout@v4
5953
- name: Set up Python ${{ matrix.python-version }}
60-
uses: actions/setup-python@v2
54+
uses: actions/setup-python@v5
6155
with:
6256
python-version: ${{ matrix.python-version }}
6357
- name: Install package and dependencies
6458
run: |
6559
python -m pip install --upgrade pip
6660
python -m pip install invoke .[test]
67-
- name: invoke unit
61+
- name: Run unit tests
6862
run: invoke unit
6963

7064

7165
# minimum:
7266
# runs-on: ${{ matrix.os }}
7367
# strategy:
7468
# matrix:
75-
# python-version: ['3.8', '3.9', '3.10', '3.11']
76-
# os: [ubuntu-20.04, macos-latest]
69+
# python-version: ['3.9']
70+
# os: [ubuntu-latest, macos-latest, windows-latest]
7771
# steps:
78-
# - uses: actions/checkout@v1
72+
# - uses: actions/checkout@v4
7973
# - name: Set up Python ${{ matrix.python-version }}
80-
# uses: actions/setup-python@v2
74+
# uses: actions/setup-python@v5
8175
# with:
8276
# python-version: ${{ matrix.python-version }}
8377
# - name: Install package and dependencies
84-
# run: pip install invoke .[test]
85-
# - name: invoke minimum
78+
# run: |
79+
# python -m pip install --upgrade pip
80+
# python -m pip install invoke .[test]
81+
# - name: Run unit tests on minimum
8682
# run: invoke minimum
87-
88-
89-
# tutorials:
90-
# runs-on: ${{ matrix.os }}
91-
# strategy:
92-
# matrix:
93-
# python-version: ['3.8', '3.9', '3.10', '3.11']
94-
# os: [ubuntu-20.04, macos-latest, windows-latest]
95-
# steps:
96-
# - uses: actions/checkout@v1
97-
# - name: Set up Python ${{ matrix.python-version }}
98-
# uses: actions/setup-python@v2
99-
# with:
100-
# python-version: ${{ matrix.python-version }}
101-
# - name: Install package and dependencies
102-
# run: pip install invoke jupyter matplotlib .
103-
# - name: invoke tutorials
104-
# run: invoke tutorials

MANIFEST.in

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

Makefile

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,9 @@ install-test: clean-build clean-pyc ## install the package and test dependencies
4444
install-develop: clean-build clean-pyc ## install the package in editable mode and dependencies for development
4545
pip install -e .[dev]
4646

47-
MINIMUM := $(shell sed -n '/install_requires = \[/,/]/p' setup.py | grep -v -e '[][]' | sed 's/ *\(.*\),$?$$/\1/g' | tr '>' '=')
48-
4947
.PHONY: install-minimum
50-
install-minimum: ## install the minimum supported versions of the package dependencies
51-
pip install $(MINIMUM)
48+
install-minimum: clean-build clean-pyc ## install the package with depencencies in minimum versions
49+
invoke install-minimum
5250

5351
.PHONY: check-dependencies
5452
check-dependencies: ## test if there are any broken dependencies
@@ -63,14 +61,17 @@ lint: ## check style with flake8 and isort
6361

6462
.PHONY: lint-sigllm
6563
lint-sigllm: ## check style with flake8 and isort
66-
flake8 sigllm tests
67-
isort -c --recursive sigllm tests
64+
ruff check sigllm/
65+
ruff format --check --diff sigllm/
66+
67+
.PHONY: lint-tests
68+
lint-tests: ## check style with flake8 and isort
69+
ruff check tests/
70+
ruff format --check --diff tests/
6871

6972
.PHONY: fix-lint
7073
fix-lint: ## fix lint issues using autoflake, autopep8, and isort
71-
find sigllm tests -name '*.py' | xargs autoflake --in-place --remove-all-unused-imports --remove-unused-variables
72-
autopep8 --in-place --recursive --aggressive sigllm tests
73-
isort --apply --atomic --recursive sigllm tests
74+
invoke fix-lint
7475

7576

7677
# TEST TARGETS
@@ -93,10 +94,6 @@ test: test-unit test-readme test-tutorials ## test everything that needs test de
9394
.PHONY: test-minimum
9495
test-minimum: install-minimum check-dependencies test ## run tests using the minimum supported dependencies
9596

96-
.PHONY: test-sigllm
97-
test: ## run tests quickly with the default Python
98-
python -m pytest --basetemp=${ENVTMPDIR} --cov=sigllm --cov-report xml
99-
10097
.PHONY: test-all
10198
test-all: ## run tests on every Python version with tox
10299
tox -r -p auto
@@ -152,34 +149,34 @@ publish: dist publish-confirm ## package and upload a release
152149
bumpversion-release: ## Merge master to stable and bumpversion release
153150
git checkout stable || git checkout -b stable
154151
git merge --no-ff master -m"make release-tag: Merge branch 'master' into stable"
155-
bumpversion release
152+
bump-my-version bump release
156153
git push --tags origin stable
157154

158155
.PHONY: bumpversion-release-test
159156
bumpversion-release-test: ## Merge master to stable and bumpversion release
160157
git checkout stable || git checkout -b stable
161158
git merge --no-ff master -m"make release-tag: Merge branch 'master' into stable"
162-
bumpversion release --no-tag
159+
bump-my-version bump release --no-tag
163160
@echo git push --tags origin stable
164161

165162
.PHONY: bumpversion-patch
166163
bumpversion-patch: ## Merge stable to master and bumpversion patch
167164
git checkout master
168165
git merge stable
169-
bumpversion --no-tag patch
166+
bump-my-version bump --no-tag patch
170167
git push
171168

172169
.PHONY: bumpversion-minor
173170
bumpversion-minor: ## Bump the version the next minor skipping the release
174-
bumpversion --no-tag minor
171+
bump-my-version bump --no-tag minor
175172

176173
.PHONY: bumpversion-major
177174
bumpversion-major: ## Bump the version the next major skipping the release
178-
bumpversion --no-tag major
175+
bump-my-version bump --no-tag major
179176

180177
.PHONY: bumpversion-candidate
181178
bumpversion-candidate: ## Bump the version to the next candidate
182-
bumpversion candidate --no-tag
179+
bump-my-version bump candidate --no-tag
183180

184181
.PHONY: bumpversion-revert
185182
bumpversion-revert: ## Undo a previous bumpversion-release

docs/conf.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838
'sphinx.ext.githubpages',
3939
'sphinx.ext.viewcode',
4040
'sphinx.ext.napoleon',
41+
'IPython.sphinxext.ipython_console_highlighting',
42+
'IPython.sphinxext.ipython_directive',
4143
]
4244

4345
ipython_execlines = [
@@ -77,7 +79,7 @@
7779
title = project + ' Documentation',
7880
copyright = '2023, MIT Data To AI Lab'
7981
author = 'MIT Data To AI Lab'
80-
description = 'Signals plus LLMs'
82+
description = 'LLMs for unsupervised time series anomaly detection.'
8183
user = 'sintel-dev'
8284

8385
# The version info for the project you're documenting, acts as replacement

0 commit comments

Comments
 (0)