Permalink
Browse files

update setup.py

  • Loading branch information...
sdpython committed Jul 26, 2016
1 parent 96c4bb5 commit 4f9d47eb40477680edaefe71149b7adbf4df3ee3
Showing with 22 additions and 13 deletions.
  1. +22 −13 setup.py
View
@@ -13,23 +13,25 @@
versionPython = "%s.%s" % (sys.version_info.major, sys.version_info.minor)
path = "Lib/site-packages/" + project_var_name
readme = 'README.rst'
requirements = None
KEYWORDS = project_var_name + ', coding goûter'
DESCRIPTION = """Exercices pour apprendre la programmation, les algorithmes, et faire des coding goûters."""
CLASSIFIERS = [
'Programming Language :: Python :: 3',
'Programming Language :: Python :: %d' % sys.version_info[0],
'Intended Audience :: Developers',
'Topic :: Scientific/Engineering',
'Topic :: Education',
'License :: OSI Approved :: MIT License',
'Development Status :: 5 - Production/Stable'
]
#######
# data
#######
packages = find_packages('src', exclude='src')
package_dir = {k: "src/" + k.replace(".", "/") for k in packages}
package_data = {project_var_name + ".scratch.example_echiquier": ["*.sb2"],
@@ -68,6 +70,7 @@ def is_local():
"unittests" in sys.argv or \
"unittests_LONG" in sys.argv or \
"unittests_SKIP" in sys.argv or \
"unittests_GUI" in sys.argv or \
"run27" in sys.argv or \
"sdist" in sys.argv or \
"setupdep" in sys.argv or \
@@ -95,7 +98,8 @@ def import_pyquickhelper():
os.path.join(
os.path.dirname(__file__),
"..",
"pyquickhelper",
"pyquickhelper" if sys.version_info[
0] >= 3 else "py27_pyquickhelper_27",
"src"))))
try:
import pyquickhelper
@@ -120,18 +124,21 @@ def verbose():
# version
##########
if is_local():
if is_local() and "--help" not in sys.argv and "--help-commands" not in sys.argv:
def write_version():
pyquickhelper = import_pyquickhelper()
from pyquickhelper.pycode import write_version_for_setup
return write_version_for_setup(__file__)
write_version()
if sys.version_info[0] != 2:
write_version()
if os.path.exists("version.txt"):
with open("version.txt", "r") as f:
lines = f.readlines()
subversion = "." + lines[0].strip("\r\n ")
if subversion == ".0":
raise Exception("subversion is wrong: " + subversion)
else:
raise FileNotFoundError("version.txt")
else:
@@ -143,6 +150,8 @@ def write_version():
##############
if os.path.exists(readme):
if sys.version_info[0] == 2:
from codecs import open
with open(readme, "r", encoding='utf-8-sig') as f:
long_description = f.read()
else:
@@ -153,9 +162,9 @@ def write_version():
if is_local():
pyquickhelper = import_pyquickhelper()
from pyquickhelper.loghelper import fLOG as logging_function
logging_function(OutputPrint=True)
logging_function = pyquickhelper.get_fLOG()
from pyquickhelper.pycode import process_standard_options_for_setup
logging_function(OutputPrint=True)
r = process_standard_options_for_setup(
sys.argv, __file__, project_var_name,
unittest_modules=["pyquickhelper"],
@@ -173,17 +182,17 @@ def write_version():
else:
r = False
if len(sys.argv) == 1 and "--help" in sys.argv:
pyquickhelper = import_pyquickhelper()
from pyquickhelper.pycode import process_standard_options_for_setup_help
process_standard_options_for_setup_help()
if not r:
if len(sys.argv) in (1, 2) and sys.argv[-1] in ("--help-commands",):
pyquickhelper = import_pyquickhelper()
from pyquickhelper.pycode import process_standard_options_for_setup_help
process_standard_options_for_setup_help(sys.argv)
setup(
name=project_var_name,
version='%s%s' % (sversion, subversion),
author='Xavier Dupré',
author_email='',
author_email='xavier.dupre@gmail.com',
url="http://lesenfantscodaient.fr/",
download_url="https://github.com/sdpython/code_beatrix/",
description=DESCRIPTION,

0 comments on commit 4f9d47e

Please sign in to comment.