Skip to content
This repository was archived by the owner on Sep 19, 2023. It is now read-only.

Commit 805aac1

Browse files
authored
Add setup.py (#390)
1 parent b26b509 commit 805aac1

File tree

4 files changed

+32
-6
lines changed

4 files changed

+32
-6
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ jobs:
2121

2222
- name: Install dependencies
2323
run: |
24-
python -m pip install -r requirements.txt
25-
python -m pip install -r test/requirements.txt
24+
python -m pip install -e .[tests]
2625
2726
- name: Check code format with Black
2827
run: |
@@ -35,4 +34,4 @@ jobs:
3534
3635
- name: Test with pytest
3736
run: |
38-
PYTHONPATH=$PWD python -m pytest test/
37+
python -m pytest test/

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,10 +319,10 @@ Advanced users could extend existing frameworks to implement customized behavior
319319

320320
```bash
321321
# Install test requirements:
322-
pip install -r test/requirements.txt
322+
pip install -e .[tests]
323323

324324
# Run unit tests:
325-
PYTHONPATH=$PWD pytest test/
325+
pytest test/
326326

327327
# Automatically reformat code:
328328
black .

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
https://github.com/SYSTRAN/storages/archive/3601019941cca224e42dc1c1435355ebcb6d2cfd.tar.gz
1+
systran-storages @ https://github.com/SYSTRAN/storages/archive/3601019941cca224e42dc1c1435355ebcb6d2cfd.tar.gz
22
jsonschema==3.*
33
pyonmttok==1.31.0
44
requests==2.*

setup.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import os
2+
3+
from setuptools import find_packages, setup
4+
5+
6+
def _load_requirements(path):
7+
with open(path, encoding="utf-8") as requirements:
8+
return [requirement.strip() for requirement in requirements]
9+
10+
11+
base_dir = os.path.dirname(os.path.abspath(__file__))
12+
install_requires = _load_requirements(os.path.join(base_dir, "requirements.txt"))
13+
tests_require = _load_requirements(os.path.join(base_dir, "test", "requirements.txt"))
14+
15+
setup(
16+
name="nmt-wizard-docker",
17+
version="0.1.0",
18+
license="MIT",
19+
description="Dockerization of NMT frameworks",
20+
author="OpenNMT",
21+
python_requires=">=3.6",
22+
install_requires=install_requires,
23+
extras_require={
24+
"tests": tests_require,
25+
},
26+
packages=find_packages(include=["nmtwizard"]),
27+
)

0 commit comments

Comments
 (0)