Skip to content

Commit

Permalink
Fix some issues with PyPI package installation (#83)
Browse files Browse the repository at this point in the history
* Add matplotlib to requirements.txt and setup.py

* Augment setup.py package finder so it can handle repo structure

* Add PyPI installation and pre-requirements to README
  • Loading branch information
karalekas authored Apr 5, 2019
1 parent 30af78e commit 3806f54
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 7 deletions.
23 changes: 18 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,25 @@ A library for quantum characterization, verification, validation (QCVV), and ben

## Installation

`forest-benchmarking` is a Python package.
It is currently in pre-release and must be installed from `master`
`forest-benchmarking` can be installed from source or via the Python package manager PyPI.

git clone https://github.com/rigetti/forest-benchmarking.git
cd forest-benchmarking/
pip install -e .
**Note**: NumPy and SciPy must be pre-installed for installation to be successful, due to cvxpy.

### Source

```bash
git clone https://github.com/rigetti/forest-benchmarking.git
cd forest-benchmarking/
pip install numpy scipy
pip install -e .
```

### PyPI

```bash
pip install numpy scipy
pip install forest-benchmarking
```

## Library Philosophy

Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ cvxpy>=1.0.0
dataclasses; python_version < "3.7"
tqdm
gitpython
matplotlib

# test dependencies
flake8
Expand Down
10 changes: 8 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ def find_version(*file_paths):
raise RuntimeError("Unable to find version string.")


def find_forest_packages():
packages = find_packages(where='forest', exclude=('tests', 'tests.*'))
return [f'forest.{name}' for name in packages]


setup(
name='forest-benchmarking',
version=find_version('forest/benchmarking', '__init__.py'),
Expand All @@ -41,7 +46,7 @@ def find_version(*file_paths):
author='Rigetti',
author_email='info@rigetti.com',
license='Apache-2.0',
packages=find_packages(exclude=('tests', 'tests.*')),
packages=find_forest_packages(),
long_description_content_type="text/markdown",
long_description=open('README.md').read(),
install_requires=[
Expand All @@ -55,6 +60,7 @@ def find_version(*file_paths):
'python-rapidjson',
'cvxpy',
'tqdm',
'gitpython'
'gitpython',
'matplotlib'
],
)

0 comments on commit 3806f54

Please sign in to comment.