Skip to content

Commit

Permalink
Move code to a src directory
Browse files Browse the repository at this point in the history
This is gaining traction in the community as well as avoiding some
potential testing pitfalls, see
https://hynek.me/articles/testing-packaging/
  • Loading branch information
pgjones committed Feb 15, 2020
1 parent d795938 commit 07723dc
Show file tree
Hide file tree
Showing 12 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ graft compliance
graft example
graft docs
graft test
graft wsproto
graft src/wsproto
prune docs/build
prune compliance/autobahntestsuite-venv
prune compliance/reports
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

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

Expand All @@ -35,9 +35,9 @@
author='Benno Rice',
author_email='benno@jeamland.net',
url='https://github.com/python-hyper/wsproto/',
packages=find_packages(exclude=['test']),
packages=find_packages("src"),
package_dir={"": "src"},
package_data={'': ['LICENSE', 'README.rst']},
package_dir={'wsproto': 'wsproto'},
python_requires=">=3.6.1",
include_package_data=True,
license='MIT',
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ deps =
black
isort
commands =
black --check --diff wsproto/ test/ example/ compliance/
isort --dont-skip __init__.py --diff --check --settings-path setup.cfg --recursive wsproto test example compliance
black --check --diff src/wsproto/ test/ example/ compliance/
isort --dont-skip __init__.py --diff --check --settings-path setup.cfg --recursive src/wsproto test example compliance

[testenv:mypy]
basepython = python3.8
deps = mypy
commands =
mypy wsproto/ test/ example/
mypy src/wsproto/ test/ example/

[testenv:lint]
basepython = python3.8
Expand Down

0 comments on commit 07723dc

Please sign in to comment.