Skip to content

Commit 2ab2d6e

Browse files
committed
make package easier to distribute
1 parent a6d20e4 commit 2ab2d6e

File tree

9 files changed

+88
-25
lines changed

9 files changed

+88
-25
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,3 +101,5 @@ ENV/
101101
.mypy_cache/
102102

103103
.gitcredentials
104+
105+
MANIFEST

LICENSE renamed to LICENSE.txt

File renamed without changes.

bin/gitconsensus

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,4 @@ if [ ! -f $ENV ]; then
1515
fi
1616
source $ENV
1717

18-
SCRIPT="$DIR/../gitconsensus/gitconsensus"
19-
$SCRIPT "$@"
18+
python -m gitconsensus.gitconsensus "$@"

gitconsensus/gitconsensus renamed to gitconsensus/gitconsensus.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
#!/usr/bin/env python3
21
import click
32
import github3
43
import os
54
import random
6-
from repository import Repository
5+
from gitconsensus.repository import Repository
76
import string
87

98
@click.group()
@@ -104,7 +103,5 @@ def close(username, repository_name):
104103
click.echo("Closing PR#%s" % (request.number,))
105104
request.close()
106105

107-
108-
109106
if __name__ == '__main__':
110107
cli()

gitconsensus/repository.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import config
1+
import gitconsensus.config
22
import datetime
33
import github3
44
import json

makefile

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,25 @@ ROOT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
66

77
all: dependencies
88

9-
fresh: fulluninstall dependencies
10-
11-
fulluninstall: uninstall cleancode
12-
13-
install:
14-
ln -s -f $(ROOT_DIR)/bin/gitconsensus /usr/local/bin/gitconsensus
15-
16-
dependencies:
17-
if [ ! -d $(ROOT_DIR)/env ]; then python3 -m venv $(ROOT_DIR)/env; fi
18-
source $(ROOT_DIR)/env/bin/activate; yes w | python3 -m pip install -r $(ROOT_DIR)/requirements.txt
19-
20-
uninstall:
21-
if [ -L /usr/local/bin/gitconsensus ]; then \
22-
rm /usr/local/bin/gitconsensus; \
23-
fi;
24-
25-
cleancode:
9+
clean:
2610
rm -rf $(ROOT_DIR)/*.pyc
2711
# Remove existing environment
2812
if [ -d $(ROOT_DIR)/env ]; then \
2913
rm -rf $(ROOT_DIR)/env; \
3014
fi;
15+
if [ -d $(ROOT_DIR)/dist ]; then \
16+
rm -rf $(ROOT_DIR)/dist; \
17+
fi;
18+
if [ -d $(ROOT_DIR)/build ]; then \
19+
rm -rf $(ROOT_DIR)/build; \
20+
fi;
21+
if [ -d $(ROOT_DIR)/gitconsensus.egg-info ]; then \
22+
rm -rf $(ROOT_DIR)/gitconsensus.egg-info; \
23+
fi;
24+
25+
dependencies:
26+
if [ ! -d $(ROOT_DIR)/env ]; then python3 -m venv $(ROOT_DIR)/env; fi
27+
source $(ROOT_DIR)/env/bin/activate; yes w | python -m pip install -e .[dev]
28+
29+
package:
30+
source $(ROOT_DIR)/env/bin/activate; python setup.py bdist_wheel

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
click==0.5
1+
click==5.0
22
github3.py==0.9.6
33
PyYAML==3.12
44
requests==2.18.4

setup.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[metadata]
2+
description-file = README.md

setup.py

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Always prefer setuptools over distutils
2+
from setuptools import setup, find_packages
3+
# To use a consistent encoding
4+
from codecs import open
5+
from os import path
6+
7+
here = path.abspath(path.dirname(__file__))
8+
9+
# Get the long description from the README file
10+
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
11+
long_description = f.read()
12+
13+
14+
setup(
15+
16+
name = 'gitconsensus',
17+
18+
version = '0.0.1.dev1',
19+
packages=find_packages(),
20+
21+
description = 'Automate Github Pull Requests using Reactions',
22+
long_description=long_description,
23+
python_requires='>=3',
24+
25+
author = 'Robert Hafner',
26+
author_email = '[email protected]',
27+
url = 'https://github.com/tedivm/gitconsensus',
28+
download_url = 'https://github.com/tedivm/gitconsensus/archive/0.1.tar.gz',
29+
keywords = 'automation github consensus git',
30+
31+
classifiers = [
32+
'Development Status :: 4 - Beta',
33+
'License :: OSI Approved :: MIT License',
34+
35+
'Intended Audience :: Developers',
36+
'Intended Audience :: System Administrators',
37+
'Topic :: Software Development :: Version Control'
38+
39+
'Programming Language :: Python :: 3',
40+
'Environment :: Console',
41+
],
42+
43+
install_requires=[
44+
'click>=5.0,<6.0',
45+
'github3.py==0.9.6,<0.10',
46+
'PyYAML>=3.12,<3.13',
47+
'requests>=2.18.0,<2.19',
48+
],
49+
50+
extras_require={
51+
'dev': [
52+
'wheel',
53+
'twine'
54+
],
55+
},
56+
57+
entry_points={
58+
'console_scripts': [
59+
'gitconsensus=gitconsensus.gitconsensus:cli',
60+
],
61+
},
62+
63+
)

0 commit comments

Comments
 (0)