Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor requirements to read from files #15

Merged
merged 4 commits into from Feb 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/unit_tests.yml
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .
pip install .[extras]
pip install pytest pytest-timeout pytest-cov

- name: Test Utils
Expand Down
9 changes: 0 additions & 9 deletions requirements.txt

This file was deleted.

2 changes: 2 additions & 0 deletions requirements/extras.txt
@@ -0,0 +1,2 @@
colour~=0.1
rapidfuzz~=1.0
8 changes: 8 additions & 0 deletions requirements/requirements.txt
@@ -0,0 +1,8 @@
mycroft-messagebus-client~=0.9.1,!=0.9.2,!=0.9.3
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'Splainit? I believe you, though.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0.9.2 and 0.9.3 had the questionable license change; it probably doesn't matter since it was later resolved, but Mycroft blacklisted those versions from their own code, so I got in the habit of doing the same..

Ignoring license, this probably could be ~=0.9

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call. I didn't make the connection.

inflection~=0.5
pexpect~=4.8
requests~=2.26
json_database~=0.6
kthread~=0.2
pyxdg~=0.27
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was supposed to be swapped for xdg and some manual code because LGPL

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is the package spec'd in ovos-core and mycroft-core.. refactoring this should be fine, but just a note that it adds another dependency to most installations. I think the refactor will also require some code changes and thus be out of scope for this PR

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's probably worth escalating, considering.

PyYAML~=5.4
28 changes: 17 additions & 11 deletions setup.py
@@ -1,5 +1,20 @@
import os
from setuptools import setup

BASEDIR = os.path.abspath(os.path.dirname(__file__))


def required(requirements_file):
""" Read requirements file and remove comments and empty lines. """
with open(os.path.join(BASEDIR, requirements_file), 'r') as f:
requirements = f.read().splitlines()
if 'MYCROFT_LOOSE_REQUIREMENTS' in os.environ:
print('USING LOOSE REQUIREMENTS!')
requirements = [r.replace('==', '>=').replace('~=', '>=') for r in requirements]
return [pkg for pkg in requirements
if pkg.strip() and not pkg.startswith("#")]


setup(
name='ovos_utils',
version='0.0.12a10',
Expand All @@ -13,18 +28,9 @@
'ovos_utils.skills',
'ovos_utils.lang'],
url='https://github.com/OpenVoiceOS/ovos_utils',
install_requires=[
"mycroft-messagebus-client",
"pexpect",
"pyxdg",
"PyYAML",
"kthread",
"json_database",
"requests",
"colour",
"inflection"],
install_requires=required("requirements/requirements.txt"),
extras_require={
"extras": ["phoneme_guesser", "colour", "rapidfuzz"]
"extras": required("requirements/extras.txt")
},
include_package_data=True,
license='Apache',
Expand Down