Skip to content

Commit

Permalink
provided more flexible setup options
Browse files Browse the repository at this point in the history
  • Loading branch information
benlipkin committed Feb 3, 2023
1 parent b28641e commit c5b77ba
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 17 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
SHELL := /usr/bin/env bash
EXEC = python=3.10
PACKAGE = probsem
INSTALL = pip install -e .
INSTALL = python -m pip install
ACTIVATE = source activate $(PACKAGE)
.DEFAULT_GOAL := help

Expand All @@ -20,7 +20,7 @@ update :
env : $(PACKAGE).egg-info/
$(PACKAGE).egg-info/ : setup.py requirements.txt
@conda create -yn $(PACKAGE) $(EXEC)
@$(ACTIVATE) ; $(INSTALL)
@$(ACTIVATE) ; $(INSTALL) -r requirements.txt ; $(INSTALL) -e ".[test]"

## test : run testing pipeline.
.PHONY : test
Expand Down
34 changes: 25 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,20 +63,36 @@ As such the `main` branch is under development and evolving. To replicate specif

## Getting Started

Requirements: [Anaconda](https://conda.io/projects/conda/en/latest/user-guide/install/index.html), [GNU Make](https://www.gnu.org/software/make/manual/make.html)

### Download the repo:
```bash
# download the repo
git clone --branch main --depth 1 [email protected]:benlipkin/probsem.git
```
### Build environment:

# build environment
make env
_Note: Multiple installation strategies are provided._

# test installation
make test
- [Anaconda](https://conda.io/projects/conda/en/latest/user-guide/install/index.html), [Make](https://www.gnu.org/software/make/manual/make.html): automatically build and populate virtual environment (recommended).
```bash
make env
```
Can test installation via:
```bash
make test
```

# NOTE: to use OpenAI models, an API key is required at ~/.openai_api_key
```

- pip[strict]: install exact dependencies used during development into current environment.
```bash
python -m pip install -r requirements.txt
```

- pip[flexible]: install general dependencies with fewer version specifications at discretion of user.
```bash
python -m pip install -e .
```

### Setup API Key:
To use OpenAI models, an API key must be placed at `~/.openai_api_key`

## Run

Expand Down
5 changes: 1 addition & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
nltk==3.7
numpy==1.23.4
openai==0.25.0
pandas==1.5.1
Expand All @@ -13,6 +12,4 @@ pylint-json2html==0.4.0
pylint-exit==1.2.0
pytest==7.2.0
pytest-html==3.2.0
coverage==6.5.0
black==22.10.0
ipython==8.5.0
coverage==6.5.0
23 changes: 21 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,26 @@
with open("README.md") as readme_file:
readme = readme_file.read()

with open("requirements.txt") as reqs_file:
requirements = reqs_file.read().split("\n")
requirements = [
"numpy",
"openai",
"pandas",
"torch",
"transformers",
"accelerate",
]

test_requirements = [
"mypy",
"lxml",
"tqdm-stubs",
"pylint",
"pylint-json2html",
"pylint-exit",
"pytest",
"pytest-html",
"coverage",
]

setup(
name="probsem",
Expand All @@ -16,5 +34,6 @@
license="MIT",
packages=find_packages(where="probsem"),
install_requires=requirements,
extras_require={"test": test_requirements},
python_requires=">=3.10",
)

0 comments on commit c5b77ba

Please sign in to comment.