Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update setup.py #262

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@

import io
from os import path
from setuptools import setup, find_packages

try:
from pip.req import parse_requirements
except ImportError:
# pip >= 10
from pip._internal.req import parse_requirements
from setuptools import setup, find_packages


def get_requirements(requirements_file):
Expand All @@ -24,28 +25,23 @@ def get_requirements(requirements_file):
if path.isfile(requirements_file):
for req in parse_requirements(requirements_file, session="hack"):
try:
# check markers, such as
#
# rope_py3k ; python_version >= '3.0'
#
if req.match_markers():
requirements.append(str(req.req))
except AttributeError:
# pip >= 20.0.2
requirements.append(req.requirement)
return requirements


if __name__ == "__main__":
HERE = path.abspath(path.dirname(__file__))
INSTALL_REQUIRES = get_requirements(path.join(HERE, "requirements.txt"))
REQUIREMENTS_FILE = path.join(HERE, "requirements.txt")
INSTALL_REQUIRES = get_requirements(REQUIREMENTS_FILE)

with io.open(path.join(HERE, "README.rst"), encoding="utf-8") as readme:
LONG_DESCRIPTION = readme.read()

def local_scheme(version):
"""Skip the local version (eg. +xyz of 0.6.1.dev4+gdf99fe2)
to be able to upload to Test PyPI"""
"""Skip the local version to be able to upload to Test PyPI."""
return ""

setup(
Expand Down