Skip to content

Commit

Permalink
Python packaging locally (keon#268)
Browse files Browse the repository at this point in the history
* Python packaging locally

* Add check install and uninstall package to Travis
  • Loading branch information
Hai Hoang Dang authored May 1, 2018
1 parent 48c1768 commit d82eb49
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,8 @@ __pycache__/
.cache/
.pytest_cache/
.coverage
# Setuptools distribution folder.
/dist/
# Python egg metadata, regenerated from source files by setuptools.
/*.egg-info
/*.egg
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,16 @@ before_script:
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
- flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
script:
# Check python install package
- pip3 install -e .
# Check unittest running
- python3 -m unittest discover tests
# Check pytest running
- python3 -m pytest tests
# Run nose with coverage support
- nosetests --with-coverage
# Check python uninstall package
- pip3 uninstall -y algorithms
notifications:
on_success: change
on_failure: change # `always` will be the setting once code changes slow down
Expand Down
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,27 @@ For running all tests write down:

$ python3 -m pytest tests

## Install
If you want to use the API algorithms in your code, it is as simple as:

$ pip3 install .

You can test by creating a python file: (Ex: use `merge_sort` in `sort`)

```python3
from sort import merge_sort

if __name__ == "__main__":
my_list = [1, 8, 3, 5, 6]
my_list = merge_sort.merge_sort(my_list)
print(my_list)
```

## Uninstall
If you want to uninstall algorithms, it is as simple as:

$ pip3 uninstall -y algorithms

## List of Implementations

- [array](array)
Expand Down
Empty file added maths/__init__.py
Empty file.
16 changes: 16 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import os
from setuptools import find_packages, setup

setup(name='algorithms',
version='1.1',
description='Pythonic Data Structures and Algorithms',
url='https://github.com/keon/algorithms',
author='Keon Kim, Hai Hoang Dang, Rahul Goswami, Christian Bender, Saad',
license='MIT',
packages=find_packages(),
classifiers=[
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
],
zip_safe=False)

0 comments on commit d82eb49

Please sign in to comment.