Skip to content

Commit 04a94ee

Browse files
authored
Merge pull request #32 from Sage-Bionetworks-Workflows/bwmac/orca-293/airflow-constraints
CI testing
2 parents 80fc916 + aa974be commit 04a94ee

File tree

6 files changed

+45
-39
lines changed

6 files changed

+45
-39
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,7 @@ MANIFEST
6060

6161
# Metaflow files
6262
.metaflow
63+
64+
# Virtual Environment Directories
65+
/venv
66+
/py-orca-venv-*

CONTRIBUTING.md

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Contributing
22

3-
Welcome to `orca` contributor's guide.
3+
Welcome to `py-orca` contributor's guide.
44

55
This document focuses on getting any potential contributor familiarized with
66
the development processes, but [other kinds of contributions] are also appreciated.
@@ -16,7 +16,7 @@ behavior guidelines.
1616

1717
## Issue Reports
1818

19-
If you experience bugs or general issues with `orca`, please have a look
19+
If you experience bugs or general issues with `py-orca`, please have a look
2020
on the [issue tracker].
2121
If you don't see anything useful there, please feel free to fire an issue report.
2222

@@ -34,17 +34,17 @@ you help us to identify the root cause of the issue.
3434

3535
## Documentation Improvements
3636

37-
You can help improve `orca` docs by making them more readable and coherent, or
37+
You can help improve py-`orca` docs by making them more readable and coherent, or
3838
by adding missing information and correcting mistakes.
3939

40-
`orca` documentation uses [Sphinx] as its main documentation compiler.
40+
`py-orca` documentation uses [Sphinx] as its main documentation compiler.
4141
This means that the docs are kept in the same repository as the project code, and
4242
that any documentation update is done in the same way was a code contribution.
4343
The documentation is written using [CommonMark] with [MyST] extensions.
4444

4545
:::{tip}
4646
Please notice that the [GitHub web interface] provides a quick way of
47-
propose changes in `orca`'s files. While this mechanism can
47+
propose changes in `py-orca`'s files. While this mechanism can
4848
be tricky for normal code contributions, it works perfectly fine for
4949
contributing to the docs, and can be quite handy.
5050

@@ -87,7 +87,7 @@ Before you work on any non-trivial code contribution it's best to first create
8787
a report in the [issue tracker] to start a discussion on the subject.
8888
This often provides additional considerations and avoids unnecessary work.
8989

90-
### Clone the repository
90+
### Development Environment Setup
9191

9292
1. Create an user account on GitHub if you do not already have one.
9393

@@ -98,22 +98,25 @@ This often provides additional considerations and avoids unnecessary work.
9898

9999
```console
100100
git clone git@github.com:Sage-Bionetworks-Workflows/py-orca.git
101-
cd orca
101+
cd py-orca
102102
```
103103

104-
4. Install `pipx` to easily run Python CLI tools like `tox` and `pipenv`.
105-
106104
4. Create an isolated virtual environment containing package dependencies,
107105
including those needed for development (*e.g.* testing, documentation) by running:
108106

109107
```console
110-
pipx run tox -e pipenv
108+
./dev_setup.sh <your_supported_python_version>
109+
source py-orca-venv-<your_supported_python_version>/bin/activate
111110
```
112111

112+
**Note:**
113+
Ensure that you have a supported Python version installed on your local machine before running `dev_setup.sh`. `py-orca` currently supports Python version 3.10 and 3.11. You can [install](https://github.com/pyenv/pyenv?tab=readme-ov-file#installation) `pyenv`for easy Python version management.
114+
115+
113116
5. Install [pre-commit] hooks:
114117

115118
```
116-
pipenv run pre-commit install
119+
pre-commit install
117120
```
118121

119122
`orca` comes with a lot of hooks configured to automatically help the

README.md

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,6 @@ Refer to [`.env.example`](.env.example) for the format of their values as well a
2424

2525
Once your environment is set, you can create a virtual environment, install the Python dependencies, and run the demonstration script (after downloading it) as follows. Note that you will need to update the `s3_prefix` parameter so that it points to an S3 bucket that is accessible to your Tower workspace.
2626

27-
### Using pipenv
28-
```bash
29-
# Create and activate a Python virtual environment (tested with Python 3.11)
30-
pipenv shell
31-
32-
# Install Python dependencies
33-
pipenv install
34-
35-
# If development dependencies are required to be installed
36-
pipenv install -d
37-
38-
# Run the script using an example dataset
39-
python3 demo.py run --dataset_id 'syn51514585' --s3_prefix 's3://orca-service-test-project-tower-bucket/outputs'
40-
```
41-
4227
### Manually creating a virtual environment
4328
```bash
4429
# Create and activate a Python virtual environment (tested with Python 3.10)

dev_setup.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
3+
# Usage: ./dev_setup.sh <python_version>
4+
5+
# Check if Python version argument is provided
6+
if [ -z "$1" ]; then
7+
echo "Please provide the Python version as an argument."
8+
exit 1
9+
fi
10+
# Check if Python version is supported
11+
if [ "$1" != "3.10" ] && [ "$1" != "3.11" ]; then
12+
echo "Unsupported Python version. Please use 3.10 or 3.11."
13+
exit 1
14+
fi
15+
# Set up and activate a Python 3.11 virtual environment
16+
python$1 -m venv py-orca-venv-$1
17+
source py-orca-venv-$1/bin/activate
18+
# Upgrade pip to latest version
19+
pip install --upgrade pip
20+
# Install airflow with constraints
21+
pip install -r requirements-airflow.txt
22+
# Install py-orca
23+
pip install -e '.[all,testing,dev]'

requirements-airflow.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-c https://raw.githubusercontent.com/apache/airflow/constraints-2.7.2/constraints-3.10.txt
2+
apache-airflow==2.7.2

tox.ini

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ passenv =
1919
HOME
2020
*_CONNECTION_URI
2121
SETUPTOOLS_*
22+
deps =
23+
-r {toxinidir}/requirements-airflow.txt
2224
extras =
2325
testing
2426
all
@@ -92,16 +94,3 @@ deps = twine
9294
commands =
9395
python -m twine check dist/*
9496
python -m twine upload {posargs:--repository {env:TWINE_REPOSITORY:testpypi}} dist/*
95-
96-
97-
[testenv:pipenv]
98-
description =
99-
Refresh the Pipfile.lock file based on the latest dependencies in setup.cfg
100-
skip_install = True
101-
changedir = {toxinidir}
102-
setenv =
103-
PIPENV_IGNORE_VIRTUALENVS = 1
104-
deps = pipenv
105-
commands =
106-
pipenv lock --dev
107-
pipenv install --dev

0 commit comments

Comments
 (0)