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

CHORE: consolidate requirements to setup.py #105

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 9 additions & 15 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,12 @@
We need to clone the project and prepare the dev environment:

```bash
$ git clone https://github.com/manrajgrover/halo.git // or using ssh: [email protected]:manrajgrover/halo.git
$ git clone https://github.com/manrajgrover/halo.git # or using ssh: [email protected]:manrajgrover/halo.git
$ cd halo
$ pip install -e .
$ pip install -e requirements-dev.txt
Copy link
Owner

Choose a reason for hiding this comment

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

We can do pip install -e .[dev] here?

```

This will install all requirements to use `halo`. You may want to create a virtual environment specifically for this.

To install development dependencies, run:

```bash
$ pip install -r requirements-dev.txt
```
This will install all requirements to use and develop `halo`. You may want to create a virtual environment specifically for this.

#### Testing
Before submitting a pull request, make sure the code passes all the tests and is clean of lint errors:
Expand All @@ -27,15 +21,15 @@ To run tests for specific environment, run:

1. For Python 2.7:

```bash
$ tox -e py27
```
```bash
$ tox -e py27
```

2. For Python 3.6:

```bash
$ tox -e py36
```
```bash
$ tox -e py36
```

For checking lint issues:

Expand Down
5 changes: 1 addition & 4 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
coverage==4.4.1
nose==1.3.7
pylint==1.7.2
tox==2.8.2
--editable .[dev]
Copy link
Owner

Choose a reason for hiding this comment

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

Same here, is this file needed?

8 changes: 1 addition & 7 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1 @@
backports.shutil_get_terminal_size==1.0.0;python_version < '3.3'
log_symbols==0.0.11
spinners==0.0.23
cursor==1.2.0
termcolor==1.1.0
colorama==0.3.9
six==1.11.0
--editable .
Copy link
Owner

Choose a reason for hiding this comment

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

I don't think we need this file now

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Aye, I'd concur with this and your other comments. I think I kept 'em in for historical reasons, or to make as few procedural changes as possible. I'm not really sure why. But I do agree — I'll remove them.

58 changes: 36 additions & 22 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
from setuptools import setup, find_packages # pylint: disable=no-name-in-module,import-error


def dependencies(file):
with open(file) as f:
return f.read().splitlines()
Copy link
Contributor Author

@theY4Kman theY4Kman Oct 27, 2018

Choose a reason for hiding this comment

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

btw, this is equivalent to list(f) or f.readlines()



setup(
name='halo',
packages=find_packages(exclude=('tests', 'examples')),
include_package_data=True,
Copy link
Owner

Choose a reason for hiding this comment

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

@theY4Kman What does this line do?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

lol, I'm not sure, tbh. The line was there previously, just below the reqs. I thought it looked out of place, so I moved it to the other line that said "package" :P

Copy link
Owner

Choose a reason for hiding this comment

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

Ah, just noticed! I should check but I remember stumbling upon an error before adding it.

version='0.0.18',
license='MIT',
description='Beautiful terminal spinners in Python',
Expand All @@ -17,26 +13,44 @@ def dependencies(file):
author_email='[email protected]',
url='https://github.com/manrajgrover/halo',
keywords=[
"console",
"loading",
"indicator",
"progress",
"cli",
"spinner",
"spinners",
"terminal",
"term",
"busy",
"wait",
"idle"
'console',
'loading',
'indicator',
'progress',
'cli',
'spinner',
'spinners',
'terminal',
'term',
'busy',
'wait',
'idle',
],
install_requires=[
'backports.shutil_get_terminal_size==1.0.0;python_version < "3.3"',
'log_symbols==0.0.11',
'spinners==0.0.23',
'cursor==1.2.0',
'termcolor==1.1.0',
'colorama==0.3.9',
'six==1.11.0',
Comment on lines +31 to +36

Choose a reason for hiding this comment

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

Since halo is a library intended to be used by other scripts, it should be liberal in its requirements.
Not pin a version at all, or use '>=' to specify a known minimal version halo needs to function properly.

],
install_requires=dependencies('requirements.txt'),
tests_require=dependencies('requirements-dev.txt'),
include_package_data=True,
extras_require={
'ipython': [
'IPython==5.7.0',
'ipywidgets==7.1.0',
]
}
],
'test': [
'coverage==4.4.1',
'nose==1.3.7',
'pylint==1.7.2',
'tox==2.8.2',
],
'dev': [
'halo[test,ipython]',
],
},
tests_require=[
'halo[test]',
],
)
7 changes: 3 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ skip_missing_interpreters =
True

[testenv]
deps =
-r{toxinidir}/requirements.txt
-r{toxinidir}/requirements-dev.txt
extras=ipython
extras=
test
ipython
recreate =
True
setenv =
Expand Down