Skip to content

Commit abb4655

Browse files
authored
Refactor build and environment setup (#6)
- Updated `build_dev.sh` to use `python -m build` instead of `setup.py`. - Modified `environment.yml` to specify Python 3.10 and updated dependencies. - Added `requirements-dev.txt` for development dependencies. - Enhanced `README.md` with clearer instructions for building from source. - Updated CI workflows to use newer action versions and Python 3.10. - Refined version handling in `versioneer.py` and `_version.py` for better compatibility.
1 parent d6659b3 commit abb4655

File tree

12 files changed

+1115
-459
lines changed

12 files changed

+1115
-459
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,11 @@ jobs:
1111
runs-on: ubuntu-latest
1212

1313
steps:
14-
- uses: actions/checkout@v2
15-
with:
16-
fetch-depth: 0
14+
- uses: actions/checkout@v4
1715
- name: Set up Python
18-
uses: actions/setup-python@v2
16+
uses: actions/setup-python@v5
1917
with:
20-
python-version: 3.8.3
18+
python-version: '3.10'
2119
- name: Install dependencies
2220
run: |
2321
python -m pip install --upgrade pip
@@ -35,12 +33,12 @@ jobs:
3533
run: |
3634
python setup.py sdist bdist_wheel
3735
- name: Upload artifacts
38-
uses: actions/upload-artifact@v2
36+
uses: actions/upload-artifact@v4
3937
with:
4038
name: bhc
4139
path: dist/
4240
- name: Upload coverage report
43-
uses: actions/upload-artifact@v2
41+
uses: actions/upload-artifact@v4
4442
with:
4543
name: coverage
4644
path: coverage_report/

.github/workflows/less-is-more.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,19 @@ name: Artifact size validation
22

33
on:
44
pull_request:
5-
branches: "**"
5+
branches: ["**"]
66

77
jobs:
88
build:
99
runs-on: ubuntu-latest
1010

1111
steps:
12-
- uses: actions/checkout@v2
13-
with:
14-
fetch-depth: 0
12+
- uses: actions/checkout@v4
1513

1614
- name: Set up Python
17-
uses: actions/setup-python@v2
15+
uses: actions/setup-python@v5
1816
with:
19-
python-version: 3.8.3
17+
python-version: '3.10'
2018

2119
- name: Install dependencies
2220
run: |

README.md

Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,51 @@ It also includes the Bayesian Rose Trees extension proposed by Blundell et al (2
99
> BLUNDELL, Charles; TEH, Yee Whye; HELLER, Katherine A. Bayesian rose trees. arXiv preprint arXiv:1203.3468, 2012.
1010
1111
## How to build from source
12+
13+
### Using Conda (Recommended)
14+
1215
1. Create an anaconda environment using the [environment.yml](environment.yml) file.
1316

14-
`$ conda env create -f environment.yml`
17+
```bash
18+
$ conda env create -f environment.yml
19+
```
1520

1621
2. Activate the environment after the installation is completed.
1722

18-
`$ conda activate bayesian-hierarchical-clustering`
23+
```bash
24+
$ conda activate bayesian-hierarchical-clustering
25+
```
26+
27+
3. Run the build script.
28+
29+
```bash
30+
$ ./build_dev.sh
31+
```
32+
33+
### Using pip
34+
35+
Alternatively, if you prefer using pip:
36+
37+
1. Create a virtual environment.
38+
39+
```bash
40+
$ python -m venv venv
41+
$ source venv/bin/activate # On Windows: venv\Scripts\activate
42+
```
1943

20-
3. Install the following libraries: `pytest`, `coverage` and `flake8`.
44+
2. Install development dependencies.
2145

22-
`$ conda install pytest coverage flake8`
46+
```bash
47+
$ pip install -r requirements-dev.txt
48+
```
2349

24-
4. Run the `build_dev.sh` script.
50+
3. Run the build script.
2551

26-
`$ ./build_dev.sh`
52+
```bash
53+
$ ./build_dev.sh
54+
```
2755

28-
The files will be available in the `dist` folder.
56+
The built packages will be available in the `dist` folder.
2957

3058
## Examples
3159

bhc/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,6 @@
1010

1111
__version__ = get_versions()['version']
1212
del get_versions
13+
14+
from . import _version
15+
__version__ = _version.get_versions()['version']

0 commit comments

Comments
 (0)