-
Notifications
You must be signed in to change notification settings - Fork 0
/
pip_install_explained
54 lines (36 loc) · 1.08 KB
/
pip_install_explained
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
Based on the article on https://python-packaging.readthedocs.io/en/latest/minimal.html
This is an explanation how to create a repository that is installable by pip.
First you need a directory structure like this:
learningml/
learningml/
__init__.py
text.py
setup.py
in __init__.py put:
"
from .text import joke
"
in test.py put:
"
def joke():
return ("This is a joke")
"
then put the following into setup.py
"
from setuptools import setup
setup(name='learningml',
version='0.1',
description='This repository demonstrates how to make a project pip installable, write a Python module in C++ and use scikit-learn, keras and spearmint.',
url='https://github.com/weissercn/learningml',
author='Constantin Weisser',
author_email='[email protected]',
license='MIT',
packages=['learningml'],
zip_safe=False)
"
to install use:
python setup.py install
To publish on Pypi, create a source distribution and upload it do:
python setup.py register sdist upload
In order for people to install your code they should type:
pip install learningml