Skip to content

Commit

Permalink
Add type annotations to public function
Browse files Browse the repository at this point in the history
  • Loading branch information
trendels committed May 7, 2021
1 parent 1727ba7 commit c9e15d4
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 4 deletions.
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
include CHANGELOG.md README.* LICENSE Makefile test_braceexpand.py
include src/braceexpand/*.pyi
include src/braceexpand/py.typed
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ README.rst: README.md
pandoc --from=markdown --to=rst $< > $@

test:
python braceexpand.py
python src/braceexpand/__init__.py
python test_braceexpand.py

.PHONY: test
9 changes: 6 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import os
import re

from setuptools import setup
from setuptools import setup, find_packages

with open('braceexpand.py') as f:
with open(os.path.join('src', 'braceexpand', '__init__.py')) as f:
version = re.findall(r"^__version__ = '(.*)'", f.read(), re.M)[0]

with open('README.rst') as f:
Expand All @@ -13,7 +14,6 @@
version=version,
author='Stanis Trendelenburg',
author_email='stanis.trendelenburg@gmail.com',
py_modules=['braceexpand'],
url='https://github.com/trendels/braceexpand',
license='MIT',
description='Bash-style brace expansion for Python',
Expand All @@ -24,4 +24,7 @@
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
],
package_dir={'': 'src'},
packages=find_packages('src'),
include_package_data=True,
)
File renamed without changes.
6 changes: 6 additions & 0 deletions src/braceexpand/__init__.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from typing import Iterator

alphabet: str

def braceexpand(pattern: str, escape: bool = ...) -> Iterator[str]: ...

Empty file added src/braceexpand/py.typed
Empty file.

0 comments on commit c9e15d4

Please sign in to comment.