Skip to content
This repository has been archived by the owner on Jul 23, 2022. It is now read-only.

Commit

Permalink
requiremntts setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
sdpython committed Feb 24, 2018
1 parent 7d27a73 commit 7d068cf
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 94 deletions.
7 changes: 5 additions & 2 deletions .local.jenkins.win.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@

language: python

python:
- { PATH: "{{replace(Python36, '\\', '\\\\')}}", VERSION: 3.6, DIST: std }
- { PATH: "{{replace(Anaconda3, '\\', '\\\\')}}", VERSION: 3.6, DIST: conda }

virtualenv:
- path: {{ospathjoin(root_path, pickname("%NAME_JENKINS%", project_name + "_%VERSION%_%DIST%_%NAME%"), "_venv")}}

install:
- pip install --no-cache-dir --no-deps --index http://localhost:8067/simple/ jyquickhelper --extra-index-url=https://pypi.python.org/simple/
- pip install --no-cache-dir --no-deps --index http://localhost:8067/simple/ pyquickhelper --extra-index-url=https://pypi.python.org/simple/
Expand All @@ -16,8 +20,7 @@ script:
- { CMD: "python -u setup.py unittests", NAME: "UT" }
after_script:
- python setup.py bdist_wheel
- if [ ${DIST} != "conda" and ${VERSION} == "3.6" and ${NAME} == "UT" ] then copy dist\*.whl {{root_path}}\..\..\local_pypi\local_pypi_server fi
- if [ ${DIST} != "conda" and ${VERSION} == "3.6" and ${NAME} == "UT" ] then copy dist\*.whl {{root_path}}\..\..\local_pypi\local_pypi_server fi
documentation:
- if [ ${NAME} == "UT" ] then python -u setup.py build_sphinx fi
- if [ ${NAME} == "UT" ] then xcopy /E /C /I /Y _doc\sphinxdoc\build\html dist\html fi

2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
dist: trusty
sudo: required
language: python

python:
- "3.5"
- "3.6"
Expand All @@ -11,7 +10,6 @@ before_install:
install:
- sudo apt-get install -qq gcc-6 g++-6
- pip install -r requirements.txt
- pip install pyquickhelper --no-deps
before_script:
- python setup.py build_ext --inplace
script:
Expand Down
3 changes: 0 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ environment:

matrix:

- PYTHON: "C:\\Python35-x64"
PYTHON_VERSION: "3.5.x"
PYTHON_ARCH: "64"
- PYTHON: "C:\\Python36-x64"
PYTHON_VERSION: "3.6.x"
PYTHON_ARCH: "64"
Expand Down
3 changes: 2 additions & 1 deletion build_script.bat
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ set pythonexe="%1"
goto custom_python:

:default_value_python:
set pythonexe="c:\Python363_x64\python.exe"
set pythonexe="c:\Python364_x64\python.exe"
if not exist %pythonexe% set pythonexe="c:\Python363_x64\python.exe"
if not exist %pythonexe% set pythonexe="c:\Python36_x64\python.exe"
:custom_python:
@echo [python] %pythonexe%
Expand Down
44 changes: 1 addition & 43 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,54 +1,12 @@
autopep8
babel!=2.0
bokeh
coverage
Cython
docformatter
falcon
falcon-auth
ipython>=5.0.0
jupyter
jupyter-client
jupyter_sphinx
jyquickhelper
keyring
Mako
matplotlib
mistune
nbconvert>=5.0.0
nbformat
nbpresent
nbsphinx
notebook>=5.0.0
numpy>=1.11.1
openpyxl
pandas>=0.20.0
pandocfilters
pillow
psutil
pycodestyle>=2.0.0
pycryptodomex
pydocstyle
pyflakes
pyquickhelper>1.6.2290
python-jenkins
PyYAML
pyquickhelper>=1.7.2438
scikit-learn
scipy
semantic_version
setuptools
Sphinx
sphinx-better-theme
sphinx-gallery
sphinx-rtd-theme
sphinxcontrib-images
sphinxcontrib-imagesvg
sphinxcontrib-jsdemo
sphinxjp.themes.sphinxjp
tornado
tqdm
ujson
unify
virtualenv
waitress
wheel
75 changes: 32 additions & 43 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@

KEYWORDS = project_var_name + ', Xavier Dupré'
DESCRIPTION = """Light REST API for machine learned models"""


CLASSIFIERS = [
'Programming Language :: Python :: 3',
'Intended Audience :: Developers',
Expand All @@ -30,12 +28,10 @@
'Development Status :: 5 - Production/Stable'
]


#######
# data
#######


packages = find_packages('src', exclude='src')
package_dir = {k: "src/" + k.replace(".", "/") for k in packages}
package_data = {
Expand All @@ -51,43 +47,27 @@ def is_local():
file = os.path.abspath(__file__).replace("\\", "/").lower()
if "/temp/" in file and "pip-" in file:
return False
if \
"bdist_msi" in sys.argv or \
"build27" in sys.argv or \
"build_script" in sys.argv or \
"build_sphinx" in sys.argv or \
"build_ext" in sys.argv or \
"bdist_wheel" in sys.argv or \
"bdist_wininst" in sys.argv or \
"clean_pyd" in sys.argv or \
"clean_space" in sys.argv or \
"copy27" in sys.argv or \
"copy_dist" in sys.argv or \
"local_pypi" in sys.argv or \
"notebook" in sys.argv or \
"publish" in sys.argv or \
"publish_doc" in sys.argv or \
"register" in sys.argv or \
"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 \
"test_local_pypi" in sys.argv or \
"upload_docs" in sys.argv or \
"setup_hook" in sys.argv or \
"copy_sphinx" in sys.argv or \
"write_version" in sys.argv:
try:
import_pyquickhelper()
except ImportError:
return False
return True
for cname in {"bdist_msi", "build27", "build_script", "build_sphinx", "build_ext",
"bdist_wheel", "bdist_egg", "bdist_wininst", "clean_pyd", "clean_space",
"copy27", "copy_dist", "local_pypi", "notebook", "publish", "publish_doc",
"register", "unittests", "unittests_LONG", "unittests_SKIP", "unittests_GUI",
"run27", "sdist", "setupdep", "test_local_pypi", "upload_docs", "setup_hook",
"copy_sphinx", "write_version"}:
if cname in sys.argv:
try:
import_pyquickhelper()
except ImportError:
return False
return True
else:
return False

return False


def ask_help():
return "--help" in sys.argv or "--help-commands" in sys.argv


def import_pyquickhelper():
try:
Expand All @@ -104,10 +84,10 @@ def import_pyquickhelper():
try:
import pyquickhelper
except ImportError as e:
message = "module pyquickhelper is needed to build the documentation ({0}), not found in path {1}".format(
message = "Module pyquickhelper is needed to build the documentation ({0}), not found in path {1} - current {2}".format(
sys.executable,
sys.path[
-1])
sys.path[-1],
os.getcwd())
raise ImportError(message) from e
return pyquickhelper

Expand All @@ -125,7 +105,7 @@ def verbose():
##########


if is_local() and "--help" not in sys.argv and "--help-commands" not in sys.argv:
if is_local() and not ask_help():
def write_version():
pyquickhelper = import_pyquickhelper()
from pyquickhelper.pycode import write_version_for_setup
Expand All @@ -147,7 +127,7 @@ def write_version():
# when the module is installed, no commit number is displayed
subversion = ""

if "upload" in sys.argv and not subversion:
if "upload" in sys.argv and not subversion and not ask_help():
# avoid uploading with a wrong subversion number
try:
import pyquickhelper
Expand Down Expand Up @@ -211,11 +191,20 @@ def write_version():
else:
r = False

if ask_help():
pyquickhelper = import_pyquickhelper()
from pyquickhelper.pycode import process_standard_options_for_setup_help
process_standard_options_for_setup_help(sys.argv)

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)
else:
pyquickhelper = import_pyquickhelper()
from pyquickhelper.pycode import clean_readme
long_description = clean_readme(long_description)
root = os.path.abspath(os.path.dirname(__file__))
if sys.platform.startswith("win"):
extra_compile_args = None
Expand Down

0 comments on commit 7d068cf

Please sign in to comment.