Skip to content

Commit

Permalink
unify repository layout
Browse files Browse the repository at this point in the history
  • Loading branch information
Kriechi committed Jun 6, 2021
1 parent d7e76bd commit 02afcab
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 45 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
- 3.6
- 3.7
- 3.8
- 3.9
- pypy3

steps:
Expand Down
3 changes: 1 addition & 2 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ dev
4.0.0 (2020-08-30)
------------------

API Changes (Backward-Incompatible)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**API Changes (Backward Incompatible)**

- Support for Python 2.7 has been removed.
- Support for Python 3.4 has been removed.
Expand Down
4 changes: 2 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
graft src
graft src/hpack
graft docs
graft test
prune bench
Expand All @@ -7,5 +7,5 @@ prune utils
exclude tasks.py
exclude test/test_fixtures/*/*.json
exclude test/test_hpack_integration.py
include README.rst LICENSE CHANGELOG.rst CONTRIBUTORS.rst tox.ini Makefile
include README.rst LICENSE CHANGELOG.rst CONTRIBUTORS.rst tox.ini
global-exclude *.pyc *.pyo *.swo *.swp *.map *.yml *.DS_Store
11 changes: 0 additions & 11 deletions Makefile

This file was deleted.

7 changes: 6 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,16 @@ hpack: HTTP/2 Header Encoding for Python
:target: https://gitter.im/python-hyper/community
:alt: Chat community

.. image:: https://raw.github.com/Lukasa/hyper/development/docs/source/images/hyper.png
.. image:: https://raw.github.com/python-hyper/documentation/master/source/logo/hyper-black-bg-white.png

This module contains a pure-Python HTTP/2 header encoding (HPACK) logic for use
in Python programs that implement HTTP/2.

Documentation
=============

Documentation is available at https://hpack.readthedocs.io .

Contributing
============

Expand Down
17 changes: 4 additions & 13 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import codecs
#!/usr/bin/env python3

import os
import re
import sys

from setuptools import setup, find_packages

Expand All @@ -12,22 +10,15 @@
with open(os.path.join(PROJECT_ROOT, 'README.rst')) as file_:
long_description = file_.read()

# Get the version
version_regex = r'__version__ = ["\']([^"\']*)["\']'
with open(os.path.join(PROJECT_ROOT, 'src/hpack/__init__.py')) as file_:
text = file_.read()
match = re.search(version_regex, text)

if match:
version = match.group(1)
else:
raise RuntimeError("No version number found!")

# Stealing this from Kenneth Reitz
if sys.argv[-1] == 'publish':
os.system('python setup.py sdist upload')
sys.exit()

setup(
name='hpack',
version=version,
Expand All @@ -38,10 +29,9 @@
author_email='cory@lukasa.co.uk',
url='https://github.com/python-hyper/hpack',
packages=find_packages(where="src"),
package_data={'': ['LICENSE', 'README.rst', 'CHANGELOG.rst']},
package_data={'hpack': []},
package_dir={'': 'src'},
python_requires='>=3.6.1',
include_package_data=True,
license='MIT License',
classifiers=[
'Development Status :: 5 - Production/Stable',
Expand All @@ -52,6 +42,7 @@
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
],
Expand Down
43 changes: 27 additions & 16 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
[tox]
envlist = py36, py37, py38, pypy3, lint, docs, packaging
envlist = py36, py37, py38, py39, pypy3, lint, docs, packaging

[gh-actions]
python =
3.6: py36
3.7: py37
3.8: py38, lint, docs, packaging
3.8: py38
3.9: py39, lint, docs, packaging
pypy3: pypy3

[testenv]
passenv =
GITHUB_*
deps =
pytest==6.0.1
pytest-cov==2.10.1
pytest-xdist==2.0.0
hypothesis>=5.5,<6
attrs==19.3.0
pytest>=6.0.1,<7
pytest-cov>=2.10.1,<3
pytest-xdist>=2.0.0,<3
hypothesis>=5.5,<7
commands =
pytest --cov-report=xml --cov-report=term --cov=hpack {posargs}

Expand All @@ -25,32 +25,41 @@ commands =
commands = pytest {posargs}

[testenv:lint]
basepython = python3.8
deps =
flake8==3.8.3
commands = flake8 --max-complexity 10 src test utils
flake8>=3.9.1,<4
commands = flake8 src/ test/ utils/

[testenv:docs]
basepython = python3.8
deps =
sphinx==3.2.1
sphinx>=4.0.2,<5
whitelist_externals = make
changedir = {toxinidir}/docs
commands =
make clean
make html

[testenv:packaging]
basepython = python3.8
basepython = python3.9
deps =
check-manifest==0.42
readme-renderer==26.0
twine==3.2.0
check-manifest==0.46
readme-renderer==29.0
twine>=3.4.1,<4
whitelist_externals = rm
commands =
rm -rf dist/
check-manifest
python setup.py sdist bdist_wheel
twine check dist/*

[testenv:publish]
basepython = {[testenv:packaging]basepython}
deps =
{[testenv:packaging]deps}
whitelist_externals = {[testenv:packaging]whitelist_externals}
commands =
{[testenv:packaging]commands}
twine upload dist/*

[testenv:bench]
deps =
{[testenv]deps}
Expand All @@ -60,4 +69,6 @@ commands =

[testenv:create_test_output]
basepython = python3.7
; rm -rf hpack-test-case/
; git clone https://github.com/http2jp/hpack-test-case.git
commands = python {toxinidir}/utils/create_test_output.py {posargs}

0 comments on commit 02afcab

Please sign in to comment.