Skip to content

Commit e3ab38a

Browse files
committed
move all code under src/
1 parent 32f868d commit e3ab38a

File tree

13 files changed

+17
-16
lines changed

13 files changed

+17
-16
lines changed

setup.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ exclude_lines =
1919

2020
[coverage:paths]
2121
source =
22-
h2/
23-
*/site-packages/h2
22+
src
23+
.tox/*/site-packages

setup.py

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,17 @@
55
import re
66
import sys
77

8-
try:
9-
from setuptools import setup
10-
except ImportError:
11-
from distutils.core import setup
8+
from setuptools import setup, find_packages
9+
10+
PROJECT_ROOT = os.path.dirname(__file__)
11+
12+
with open(os.path.join(PROJECT_ROOT, 'README.rst')) as file_:
13+
long_description = file_.read()
1214

1315
# Get the version
1416
version_regex = r'__version__ = ["\']([^"\']*)["\']'
15-
with open('h2/__init__.py', 'r') as f:
16-
text = f.read()
17+
with open(os.path.join(PROJECT_ROOT, 'src/h2/__init__.py')) as file_:
18+
text = file_.read()
1719
match = re.search(version_regex, text)
1820

1921
if match:
@@ -26,20 +28,19 @@
2628
os.system('python setup.py sdist upload')
2729
sys.exit()
2830

29-
readme = codecs.open('README.rst', encoding='utf-8').read()
30-
history = codecs.open('HISTORY.rst', encoding='utf-8').read()
31-
3231
setup(
3332
name='h2',
3433
version=version,
3534
description='HTTP/2 State-Machine based protocol implementation',
36-
long_description=u'\n\n'.join([readme, history]),
35+
long_description=long_description,
36+
long_description_content_type='text/x-rst',
3737
author='Cory Benfield',
3838
author_email='[email protected]',
3939
url='https://github.com/python-hyper/hyper-h2',
40-
packages=['h2'],
40+
packages=find_packages(where="src"),
4141
package_data={'': ['LICENSE', 'README.rst', 'HISTORY.rst']},
42-
package_dir={'h2': 'h2'},
42+
package_dir={'': 'src'},
43+
python_requires='>=3.6.1',
4344
include_package_data=True,
4445
license='MIT License',
4546
classifiers=[

h2/__init__.py renamed to src/h2/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
"""
3-
h2
3+
hyper-h2
44
~~
55
66
A HTTP/2 implementation.
File renamed without changes.
File renamed without changes.

h2/errors.py renamed to src/h2/errors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# -*- coding: utf-8 -*-
22
"""
33
h2/errors
4-
~~~~~~~~~~~~~~~~~~~
4+
~~~~~~~~~
55
66
Global error code registry containing the established HTTP/2 error codes.
77
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)