Skip to content

Commit

Permalink
refactor(reqs): move requirements to folder
Browse files Browse the repository at this point in the history
  • Loading branch information
roedoejet committed Nov 19, 2021
1 parent 223390a commit 5a606e1
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 37 deletions.
3 changes: 1 addition & 2 deletions .travis.yml
Expand Up @@ -8,7 +8,7 @@ python:
# install system dependencies here with apt-get.
before_install:
- sudo apt-get update -y
- sudo apt-get install -y python3 python3-pip python-dev build-essential
- sudo apt-get install -y python3 python3-pip python-dev build-essential git

# install python dependencies including this package in the travis
# virtualenv
Expand All @@ -23,7 +23,6 @@ install:
# Install testing requirements
- pip3 install coverage
- pip3 install coveralls
- pip3 install gunicorn

before_script:
- gunicorn --worker-class eventlet -w 1 g2p.app:APP --no-sendfile --bind 0.0.0.0:5000 --daemon
Expand Down
1 change: 1 addition & 0 deletions Dockerfile
Expand Up @@ -10,6 +10,7 @@ RUN apt-get install -y libffi-dev openssl libssl-dev python3 python3-pip python3
RUN mkdir /g2p
RUN mkdir /g2p/g2p
COPY g2p /g2p/g2p
COPY requirements /g2p/requirements
COPY requirements.txt /g2p
COPY setup.py /g2p
COPY README.md /g2p
Expand Down
24 changes: 4 additions & 20 deletions requirements.txt
@@ -1,20 +1,4 @@
openpyxl
click
coloredlogs<=14.0
dnspython>=2.1.0
eventlet>=0.33.0
flask-cors>=3.0.9
Flask>=2.0.0
flask_socketio==4.3.2
flask-talisman>=0.7.0
flask-restful>=0.3.9
gunicorn @ git+https://github.com/benoitc/gunicorn.git@ff58e0c
networkx
panphon>=0.19
python-engineio==3.14.2
python-socketio==4.6.1
pyyaml>=5.2
regex
requests
tqdm
text_unidecode
# Minimal requirements for all uses of g2p
-r requirements/requirements.txt
# Additional requirements for production deployment
-r requirements/requirements.prod.txt
1 change: 1 addition & 0 deletions requirements/readme.md
@@ -0,0 +1 @@
All development and normal use requirements are in requirements.txt - we use a specific version of gunicorn to run the g2p studio in production, and don't want to introduce git as a dependency, so we separate these requirements here.
1 change: 1 addition & 0 deletions requirements/requirements.prod.txt
@@ -0,0 +1 @@
gunicorn @ git+https://github.com/benoitc/gunicorn.git@ff58e0c
19 changes: 19 additions & 0 deletions requirements/requirements.txt
@@ -0,0 +1,19 @@
openpyxl
click
coloredlogs<=14.0
dnspython>=2.1.0
eventlet>=0.33.0
flask-cors>=3.0.9
Flask>=2.0.0
flask_socketio==4.3.2
flask-talisman>=0.7.0
flask-restful>=0.3.9
networkx
panphon>=0.19
python-engineio==3.14.2
python-socketio==4.6.1
pyyaml>=5.2
regex
requests
tqdm
text_unidecode
29 changes: 14 additions & 15 deletions setup.py
@@ -1,43 +1,42 @@
''' Setup for g2p
'''
""" Setup for g2p
"""
from os import path
import datetime as dt
from setuptools import setup, find_packages

build_no = dt.datetime.today().strftime('%Y%m%d')
build_no = dt.datetime.today().strftime("%Y%m%d")

# Ugly hack to read the current version number without importing g2p:
# (works by )
with open("g2p/_version.py", "r", encoding="utf8") as version_file:
namespace = {}
exec(version_file.read(), namespace)
VERSION = namespace['VERSION'] + "." + build_no
VERSION = namespace["VERSION"] + "." + build_no

this_directory = path.abspath(path.dirname(__file__))

with open(path.join(this_directory, 'README.md'), encoding='utf8') as f:
with open(path.join(this_directory, "README.md"), encoding="utf8") as f:
long_description = f.read()

with open(path.join(this_directory, 'requirements.txt'), encoding='utf8') as f:
with open(
path.join(this_directory, "requirements", "requirements.txt"), encoding="utf8"
) as f:
REQS = f.read().splitlines()

setup(
name='g2p',
python_requires='>=3.6',
name="g2p",
python_requires=">=3.6",
version=VERSION,
author="Aidan Pine",
author_email="hello@aidanpine.ca",
license="MIT",
url="https://github.com/roedoejet/g2p",
description='Module for creating context-aware, rule-based G2P mappings that preserve indices',
description="Module for creating context-aware, rule-based G2P mappings that preserve indices",
long_description=long_description,
long_description_content_type='text/markdown',
long_description_content_type="text/markdown",
packages=find_packages(),
include_package_data=True,
install_requires=REQS,
entry_points={
'console_scripts': [
'g2p = g2p.cli:cli'
]},
zip_safe=False
entry_points={"console_scripts": ["g2p = g2p.cli:cli"]},
zip_safe=False,
)

0 comments on commit 5a606e1

Please sign in to comment.