Skip to content

Commit d6ade40

Browse files
committed
fix packaging
1 parent 20acbd8 commit d6ade40

9 files changed

Lines changed: 233 additions & 104 deletions

File tree

.coveragerc

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
[run]
2+
branch = True
3+
source = giturlsparse
4+
5+
[report]
6+
omit =
7+
# Regexes for lines to exclude from consideration
8+
exclude_lines =
9+
# Have to re-enable the standard pragma
10+
pragma: no cover
11+
12+
# Don't complain about missing debug-only code:
13+
def __repr__
14+
if self\.debug
15+
16+
# Don't complain if tests don't hit defensive assertion code:
17+
raise AssertionError
18+
raise NotImplementedError
19+
20+
# Don't complain if non-runnable code isn't run:
21+
if 0:
22+
if __name__ == .__main__.:
23+
24+
ignore_errors = True
25+
26+
[html]
27+
directory = coverage_html

.editorconfig

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 4
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true
11+
max_line_length = 80
12+
13+
[*.md]
14+
trim_trailing_whitespace = false
15+
16+
[*.rst]
17+
max_line_length = 80
18+
19+
[*.py]
20+
max_line_length = 100
21+
22+
[*.{scss,html}]
23+
indent_size = 2
24+
indent_style = space
25+
max_line_length = 120
26+
27+
[*.js]
28+
indent_size = 2
29+
max_line_length = 120
30+
31+
[*.yml]
32+
indent_size = 2
33+
34+
[Makefile]
35+
indent_style = tab

MANIFEST.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
include LICENSE
2+
include README.rst
3+
recursive-include giturlparse *py

README.md

Lines changed: 0 additions & 79 deletions
This file was deleted.

README.rst

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
===========
2+
giturlparse
3+
===========
4+
5+
Parse & rewrite git urls (supports GitHub, Bitbucket, FriendCode, Assembla, Gitlab ...)
6+
7+
This is a fork of giturlparse.py with updated parsers.
8+
9+
Original project can be found at https://github.com/FriendCode/giturlparse.py
10+
11+
**********
12+
Installing
13+
**********
14+
15+
::
16+
17+
pip install giturlparse.py
18+
19+
********
20+
Examples
21+
********
22+
23+
Parse
24+
=====
25+
26+
::
27+
28+
from giturlparse import parse
29+
30+
p = parse('[email protected]:AaronO/some-repo.git')
31+
32+
p.host, p.owner, p.repo
33+
34+
# => ('bitbucket.org', 'AaronO', 'some-repo')
35+
36+
37+
Rewrite
38+
=======
39+
40+
::
41+
42+
from giturlparse import parse
43+
44+
url = '[email protected]:Org/Private-repo.git'
45+
46+
p = parse(url)
47+
48+
p.url2ssh, p.url2https, p.url2git, p.url2http
49+
# => ('[email protected]:Org/Private-repo.git', 'https://github.com/Org/Private-repo.git', 'git://github.com/Org/Private-repo.git', None)
50+
51+
****
52+
URLS
53+
****
54+
55+
Alternative URLs for same repo::
56+
57+
from giturlparse import parse
58+
59+
url = '[email protected]:Org/Private-repo.git'
60+
61+
parse(url).urls
62+
# => {
63+
# 'ssh': '[email protected]:Org/Private-repo.git',
64+
# 'https': 'https://github.com/Org/Private-repo.git',
65+
# 'git': 'git://github.com/Org/Private-repo.git'
66+
# }
67+
68+
69+
**********
70+
Validate::
71+
**********
72+
73+
::
74+
75+
from giturlparse import parse, validate
76+
77+
url = '[email protected]:Org/Private-repo.git'
78+
79+
parse(url).valid
80+
# => True
81+
82+
# Or
83+
84+
validate(url)
85+
# => True
86+
87+
88+
89+
*****
90+
Tests
91+
*****
92+
93+
::
94+
95+
python setup.py test
96+
97+
98+
*******
99+
License
100+
*******
101+
102+
Apache v2 (Check out LICENSE file)

giturlparse/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
# Imports
1+
__author__ = 'Iacopo Spalletti'
2+
__email__ = '[email protected]'
3+
__version__ = '0.9.dev1'
4+
25
from giturlparse.parser import parse as _parse
36
from giturlparse.result import GitUrlParsed
47

setup.cfg

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[flake8]
2+
exclude = *.egg-info,.git,.settings,.tox,build,dist
3+
max-line-length = 99
4+
5+
[metadata]
6+
license-file = LICENSE
7+
8+
[wheel]
9+
universal = 1
10+
11+
[isort]
12+
line_length = 99
13+
combine_as_imports = true
14+
default_section = THIRDPARTY
15+
include_trailing_comma = true
16+
known_first_party = giturlparse
17+
multi_line_output = 5
18+
not_skip = __init__.py

setup.py

Lines changed: 29 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,43 @@
1-
#!/usr/bin/python
1+
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*-
3+
import giturlparse
24

35
try:
4-
from setuptools import setup, Extension
5-
has_setuptools = True
6+
from setuptools import setup
67
except ImportError:
7-
from distutils.core import setup, Extension
8-
has_setuptools = False
8+
from distutils.core import setup
99

10-
version_string = '0.1.0'
10+
version = giturlparse.__version__
1111

1212

13-
setup_kwargs = {}
13+
readme = open('README.rst').read()
1414

15-
# Requirements
16-
install_requires = [
17-
# PyPi
1815

19-
# Non PyPi
20-
]
21-
dependency_links = [
22-
]
23-
24-
setup(name='giturlparse',
16+
setup(
17+
name='giturlparse',
18+
version=version,
2519
description='A Git URL parsing module (supports parsing and rewriting)',
26-
keywords='git url parse ssh github bitbucket',
27-
version=version_string,
28-
url='https://github.com/FriendCode/giturlparse.py',
20+
long_description=readme,
2921
license='Apache v2',
3022
author="Aaron O'Mullan",
3123
author_email='[email protected]',
32-
long_description="""
33-
""",
24+
url='https://github.com/yakky/giturlparse',
25+
maintainer='Iacopo Spalletti',
26+
maintainer_email='[email protected]',
3427
packages=['giturlparse', 'giturlparse.platforms'],
35-
install_requires=install_requires,
36-
dependency_links=dependency_links,
37-
**setup_kwargs
28+
include_package_data=True,
29+
install_requires=[
30+
],
31+
keywords='git url parse ssh github bitbucket',
32+
classifiers=[
33+
'Development Status :: 5 - Production/Stable',
34+
'Intended Audience :: Developers',
35+
'License :: OSI Approved :: BSD License',
36+
'Natural Language :: English',
37+
'Programming Language :: Python :: 2',
38+
'Programming Language :: Python :: 2.7',
39+
'Programming Language :: Python :: 3',
40+
'Programming Language :: Python :: 3.4',
41+
'Programming Language :: Python :: 3.5',
42+
],
3843
)

tox.ini

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[tox]
2+
envlist = pep8,isort,py{36,35,34,27}
3+
4+
[testenv]
5+
commands = {env:COMMAND:python} setup.py test
6+
7+
[testenv:isort]
8+
deps = isort
9+
commands = isort -c -rc -df giturlparse
10+
skip_install = true
11+
12+
[testenv:pep8]
13+
deps = flake8
14+
commands = flake8
15+
skip_install = true

0 commit comments

Comments
 (0)