Skip to content

Commit 87e41e4

Browse files
committed
BLD/MAINT: Remove poetry and replace with setuptools
Poetry is overkill for a project with very few dependencies.
1 parent 9f27e7e commit 87e41e4

File tree

9 files changed

+91
-547
lines changed

9 files changed

+91
-547
lines changed

.github/workflows/build-and-test.yml

+7-24
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ on:
55
branches: [ main ]
66
pull_request:
77
branches: [ main ]
8-
types: [ labeled ]
98

109
workflow_dispatch:
1110

@@ -15,8 +14,8 @@ jobs:
1514

1615
strategy:
1716
matrix:
18-
os: [ ubuntu-20.04, macOS-10.15, windows-2019 ]
19-
python-version: [ '3.6', '3.7', '3.8', '3.9' ]
17+
os: [ ubuntu-20.04, macOS-11, windows-2019 ]
18+
python-version: [ '3.8', '3.9', '3.10', '3.11' ]
2019

2120
name: Python version - ${{ matrix.python-version }} - ${{ matrix.os }}
2221
steps:
@@ -27,32 +26,16 @@ jobs:
2726
with:
2827
python-version: ${{ matrix.python-version }}
2928

30-
- name: Cache/restor poetry lockfile
31-
uses: actions/cache@v2
32-
with:
33-
path: .
34-
key: deps-${{ hashFiles('poetry.lock') }}
35-
restore-keys: deps-
36-
37-
- name: Install BLAS on Ubuntu for numpy's build to work on Python3.9
38-
if: ${{matrix.os == 'ubuntu-20.04' && matrix.python-version == '3.9'}}
39-
run: |
40-
sudo apt-get install -y libopenblas-dev
41-
4229
- name: Install Dependencies
43-
env:
44-
CFLAG: '-std=c99'
4530
run: |
4631
python3 -m pip install --upgrade pip setuptools wheel
47-
pip install poetry
48-
poetry install
49-
32+
pip install -r requirements-dev.txt
5033
- name: Run Pytest, report coverage
5134
run: |
52-
poetry run pytest -v --cov-branch --cov=pyloras tests/ --cov-report=xml
53-
35+
pip install -e .
36+
pytest -v --cov-branch --cov=polyagamma tests/ --cov-report=xml
5437
- name: Upload coverage to Codecov
55-
uses: codecov/codecov-action@v1
38+
uses: codecov/codecov-action@v3
5639
with:
5740
files: ./coverage.xml
58-
fail_ci_if_error: true
41+
fail_ci_if_error: false

.github/workflows/release.yml

+23-23
Original file line numberDiff line numberDiff line change
@@ -14,54 +14,54 @@ jobs:
1414

1515
strategy:
1616
matrix:
17-
os: [ ubuntu-20.04 ]
18-
python-version: [ '3.6' ]
17+
os: [ ubuntu-20.04, macOS-11, windows-2019 ]
18+
python-version: [ '3.8' ]
1919

2020
steps:
21-
- uses: actions/checkout@v2
21+
- uses: actions/checkout@v3
2222

2323
- name: Set up Python
2424
uses: actions/setup-python@v2
2525
with:
2626
python-version: ${{ matrix.python-version }}
2727

28-
- name: Cache/restore poetry lockfile
29-
uses: actions/cache@v2
30-
with:
31-
path: .
32-
key: deps-${{ hashFiles('poetry.lock') }}
33-
restore-keys: deps-
34-
35-
- name: Install Dependencies and Cythonize extension
28+
- name: Install Dependencies
3629
run: |
37-
python3 -m pip install --upgrade pip setuptools wheel
38-
pip install poetry
39-
poetry install
30+
python3 -m pip install --upgrade pip setuptools wheel cibuildwheel==2.12.3
31+
pip install -r requirements-dev.txt
32+
33+
- name: Build wheels
34+
run: cibuildwheel --output-dir wheelhouse --config-file pyproject.toml
4035

41-
- name: Build wheel and source distribution
42-
run: poetry build
36+
- name: Build source distribution
37+
if: ${{ matrix.os == 'ubuntu-20.04' }}
38+
run: |
39+
python -m build --sdist
40+
mv dist/*.gz wheelhouse
4341
4442
- name: Store the wheelhouse directory
45-
uses: actions/upload-artifact@v2
43+
uses: actions/upload-artifact@v3
4644
with:
4745
name: wheels_and_sdist
48-
path: dist
46+
path: wheelhouse
4947
if-no-files-found: error
5048

51-
5249
upload_pypi:
5350
needs: [ build_wheels_and_sdist ]
5451
runs-on: ubuntu-20.04
52+
environment:
53+
name: pypi
54+
url: https://pypi.org/p/pyloras
55+
permissions:
56+
id-token: write
5557
steps:
5658
- name: Pull built wheels and sdist
57-
uses: actions/download-artifact@v2
59+
uses: actions/download-artifact@v3
5860
with:
5961
name: wheels_and_sdist
6062
path: dist
6163

6264
- name: Publish to PyPI
63-
uses: pypa/gh-action-pypi-publish@v1.4.2
65+
uses: pypa/gh-action-pypi-publish@v1.8.5
6466
with:
65-
user: __token__
66-
password: ${{ secrets.PYPI_TOKEN }}
6767
packages_dir: dist

MANIFEST.in

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
prune .github
2+
prune .gitignore
3+
prune scripts
4+
prune tests

Makefile

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
.PHONY: clean install test sdist wheels
2+
3+
clean:
4+
rm -Rf build/* dist/* ./pyloras.egg-info **/*__pycache__ __pycache__ .coverage*
5+
6+
dev:
7+
pip install -r requirements-dev.txt
8+
9+
sdist:
10+
python -m build --sdist
11+
12+
wheel:
13+
python -m build --wheel
14+
15+
test:
16+
pytest tests/ -vvv
17+
18+
test-cov: clean
19+
pytest tests/ -vv --cov-branch --cov=pyloras tests/ --cov-report=html

README.md

+9-10
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,16 @@
77
Localized Random Affine Shadowsampling
88

99
This repo provides a python implementation of an imbalanced dataset oversampling
10-
technique known as Localized Random Affine Shadowsampling (LoRAS). This implementation
11-
piggybacks off the package ``imbalanced-learn`` and thus aims to be as compatible
12-
as possible with it.
10+
technique known as Localized Random Affine Shadowsampling (LoRAS). It also provides
11+
implementations of several other over/under-sampling algorithms not yet available in
12+
the ``imbalanced-learn`` package. These implementations piggybacks off of ``imbalanced-learn``
13+
and thus aim to be as compatible as possible with it.
1314

1415

1516
## Dependencies
16-
- `Python >= 3.6`
17-
- `numpy >= 1.17.0`
18-
- `imbalanced-learn`
17+
- `Python >= 3.8`
18+
- `numpy >= 1.17.3`
19+
- `imbalanced-learn < 1.0.0`
1920

2021

2122
## Installation
@@ -25,13 +26,11 @@ Using `pip`:
2526
$ pip install -U pyloras
2627
```
2728

28-
Installing from source requires an installation of [poetry][1] and the following shell commands:
29+
Alternatively, one can install from source with the following shell commands:
2930
```shell
3031
$ git clone https://github.com/zoj613/pyloras.git
3132
$ cd pyloras/
32-
$ poetry install
33-
# add package to python's path
34-
$ export PYTHONPATH=$PWD:$PYTHONPATH
33+
$ pip install .
3534
```
3635

3736
## Usage

0 commit comments

Comments
 (0)