Skip to content

Commit 4877b6f

Browse files
Craig Sandersfacebook-github-bot
authored andcommitted
make installation and starting the server easier (#62)
Summary: Pull Request resolved: #62 These changes will allow aepsych to be hosted on pypi and installed from pip; also allows a server to be started with a simple command Reviewed By: mshvartsman Differential Revision: D37176812 fbshipit-source-id: 4d34e9c5bd51918d583fd1608fbdb92d1f8a4832
1 parent 906286b commit 4877b6f

3 files changed

Lines changed: 50 additions & 8 deletions

File tree

aepsych/server/server.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
import pandas as pd
2020
import torch
2121
from aepsych.config import Config
22-
from aepsych.strategy import SequentialStrategy
2322
from aepsych.server.sockets import DummySocket, createSocket
23+
from aepsych.strategy import SequentialStrategy
2424

2525
logger = utils_logging.getLogger(logging.INFO)
2626

@@ -845,7 +845,7 @@ def start_server(server_class, args):
845845
raise RuntimeError(e)
846846

847847

848-
def main(server_class):
848+
def main(server_class=AEPsychServer):
849849
args = parse_argument()
850850
if args.logs:
851851
# overide logger path

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build-system]
2+
requires = ["setuptools>=42", "wheel"]
3+
build-backend = "setuptools.build_meta"

setup.py

Lines changed: 45 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,57 @@
55
# This source code is licensed under the license found in the
66
# LICENSE file in the root directory of this source tree.
77

8-
from os import path
8+
import os
99

10-
from setuptools import setup, find_packages
10+
from setuptools import find_packages, setup
1111

12-
this_directory = path.abspath(path.dirname(__file__))
13-
with open(path.join(this_directory, "Readme.md"), encoding="utf-8") as f:
14-
long_description = f.read()
12+
root_dir = os.path.dirname(__file__)
13+
14+
REQUIRES = [
15+
"matplotlib",
16+
"torch",
17+
"pyzmq==19.0.2",
18+
"scipy",
19+
"sklearn",
20+
"gpytorch>=1.4",
21+
"botorch>=0.6.1",
22+
"SQLAlchemy",
23+
"dill",
24+
"pandas",
25+
"tqdm",
26+
"pathos",
27+
]
28+
29+
DEV_REQUIRES = [
30+
"coverage",
31+
"flake8",
32+
"black",
33+
"numpy>=1.20, " "sqlalchemy-stubs", # for mypy stubs
34+
"mypy",
35+
"parameterized",
36+
]
37+
38+
with open(os.path.join(root_dir, "README.md"), "r") as fh:
39+
long_description = fh.read()
1540

1641
setup(
1742
name="aepsych",
18-
version="0.1",
43+
version="0.1.0",
44+
python_requires=">=3.8",
1945
packages=find_packages(),
46+
description="Adaptive experimetation for psychophysics",
2047
long_description=long_description,
2148
long_description_content_type="text/markdown",
49+
install_requires=REQUIRES,
50+
entry_points={
51+
"console_scripts": [
52+
"aepsych_server = aepsych.server.server:main",
53+
],
54+
},
55+
)
56+
57+
extras_require = (
58+
{
59+
"dev": DEV_REQUIRES,
60+
},
2261
)

0 commit comments

Comments
 (0)