Skip to content

Commit

Permalink
fix automate setup
Browse files Browse the repository at this point in the history
  • Loading branch information
sirfoga committed Oct 12, 2018
1 parent e17d427 commit 02d5406
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 23 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ script:
- "make show-installed-version"
- "make test" # test coverage
- "codecov"
- "python3 -m pylint 'hal/'" # measure code lint
- "# make docs" # generate docs
- "python3 -m pylint hal/ || pylint-exit $?" # measure code lint
- "make docs" # generate docs
notifications:
email: "false" # no email notify
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ flake8:
pipenv run flake8 --ignore=E501,F401,E128,E402,E731,F821,E722 hal

pylint:
pylint3 -j 8 hal/*
pylint3 -j 8 hal/* || pylint-exit $?

coverage:
pipenv run py.test --cov-config .coveragerc --verbose --cov-report term --cov-report xml --cov=requests tests
Expand Down
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,16 +100,17 @@ channel_feed = YoutubeChannel(channel_name).get_feed_url()

Different ways, all equals

### via `pipenv`
- ```$ pipenv install .```
- ```$ make install```

### via `pip`
- ```$ pip3 install . --upgrade --force-reinstall``` from the source
- ```$ pip3 install PyHal``` via [pip](https://pypi.org/project/PyHal/)
- ```$ make pip-install```

### via `pipenv`
- ```$ pipenv install --dev --skip-lock ```
- ```$ make install```

```make fast-init``` just copies source files to distitribution files ... run it only if you're sure about dependencies
### fast install
- ```make fast-init```
*just copies source files to distitribution files ... run it only if you're sure about dependencies*


## Usage and documentation
Expand Down
1 change: 0 additions & 1 deletion VERSION

This file was deleted.

2 changes: 1 addition & 1 deletion hal/__version__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__title__ = 'hal'
__title__ = 'PyHal'
__description__ = 'Your swiss knife to perform fast and easy pythonic stuff'
__url__ = 'https://sirfoga.github.io/pyhal/'
__version__ = '10.2.3'
Expand Down
46 changes: 34 additions & 12 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,52 @@

from setuptools import setup, find_packages

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

def get_version_details(path):
"""Parses version file
LITTLE_DESCRIPTION = "Your swiss knife to perform fast and easy pythonic stuff"
:param path: path to version file
:return: version details
"""

with open(path, "r") as reader:
lines = reader.readlines()
data = {
line.split(" = ")[0].replace("__", ""):
line.split(" = ")[1].strip().replace("'", "")
for line in lines
}
return data


# folders
HERE = os.path.abspath(os.path.dirname(__file__))
SRC_FOLDER = os.path.join(HERE, "hal")

# version
VERSION_FILE = os.path.join(SRC_FOLDER, "__version__.py")
VERSION = get_version_details(VERSION_FILE)

# descriptions
LITTLE_DESCRIPTION = VERSION["description"]
DESCRIPTION = \
"HAL\n" + LITTLE_DESCRIPTION + "\n\
Install\n\
- $ pip install . --upgrade --force-reinstall, from the source\n\
- $ make install, with pipenv\n\
- $ make pip-install, with pip\n\
- $ pip install PyHal, via pip\n\
Questions and issues\n\
The Github issue tracker is only for bug reports and feature requests."
VERSION = open("VERSION").readlines()[0]
VERSION_NUMBER = VERSION.split(" ")[0]


setup(
name="PyHal",
version=VERSION_NUMBER,
author="sirfoga",
author_email="sirfoga@protonmail.com",
name=VERSION["title"],
version=VERSION["version"],
author=VERSION["author"],
author_email=VERSION["author_email"],
description=LITTLE_DESCRIPTION,
long_description=DESCRIPTION,
keywords="hal library general-purpose",
url="https://github.com/sirfoga/pyhal",
packages=find_packages(exclude=["tests"]),
test_suite="tests"
url=VERSION["url"],
packages=find_packages(exclude=["tests"])
)
File renamed without changes.

0 comments on commit 02d5406

Please sign in to comment.