Skip to content

Commit

Permalink
Use setup.py instead of Pipfile for packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
keitheis committed Feb 26, 2018
1 parent d6324ee commit 5ecb850
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 306 deletions.
20 changes: 0 additions & 20 deletions Pipfile

This file was deleted.

265 changes: 0 additions & 265 deletions Pipfile.lock

This file was deleted.

File renamed without changes.
33 changes: 12 additions & 21 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,15 @@
source_root = os.path.dirname(os.path.abspath(__file__))


def read_requirements_as_package_names():
"""
Get dependencies listed in a given requirements file.
1. Packages in 'requirements.txt' are excluded
2. Lines in `pipenv-requirements.txt` may be empty or starting with '#';
they should be skipped.
3. Lines may have post-comment, so they should be spilt by spaces
and get the first part.
"""
requirements_path = os.path.join(source_root, "pipenv-requirements.txt")
with open(requirements_path, "r") as f:
stripped_lines = (line.strip() for line in f)
valid_lines = (
line for line in stripped_lines
if line and not line.startswith("#") and not line.startswith("-r")
)
valid_package_names = [
line.split()[0].replace(";", "") for line in valid_lines
]
return valid_package_names
required_dev = [
'pytest',
'pytest-runner',
"coverage",
"pytest-cov",
"flake8",
"pytest-flake8",
"tox"
]


setup(
Expand All @@ -35,13 +24,15 @@ def read_requirements_as_package_names():
long_description=open(os.path.join(source_root, "README.md")).read(),
license="UNLICENSE",
url="https://github.com/iCHEF/queryfilter",
install_requires=read_requirements_as_package_names(),
tests_require=['pipenv'], # Use pipenv install --dev
packages=find_packages(str(source_root)),
package_data={
"": ["*.pyi", "*.md"],
},
setup_requires=["pytest-runner"],
extras_require={
'dev': required_dev
},
classifiers=[
"iCHEF :: Private",
"Development Status :: 1 - Planning",
Expand Down

0 comments on commit 5ecb850

Please sign in to comment.