diff --git a/Makefile b/Makefile index 80216ad..5f07044 100644 --- a/Makefile +++ b/Makefile @@ -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 @@ -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 diff --git a/README.md b/README.md index 89e4da9..cc1a36b 100644 --- a/README.md +++ b/README.md @@ -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 git@github.com: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 diff --git a/requirements.txt b/requirements.txt index 968b786..78a8036 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,3 @@ -nltk==3.7 numpy==1.23.4 openai==0.25.0 pandas==1.5.1 @@ -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 \ No newline at end of file diff --git a/setup.py b/setup.py index 14a6e1f..b594509 100644 --- a/setup.py +++ b/setup.py @@ -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", @@ -16,5 +34,6 @@ license="MIT", packages=find_packages(where="probsem"), install_requires=requirements, + extras_require={"test": test_requirements}, python_requires=">=3.10", )