| Conditions | 1 |
| Total Lines | 89 |
| Code Lines | 78 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
| 1 | """Web server Tableau uses to run Python scripts. |
||
| 16 | def setup_package(): |
||
| 17 | def read(fname): |
||
| 18 | return open(os.path.join(os.path.dirname(__file__), fname)).read() |
||
| 19 | |||
| 20 | setup( |
||
| 21 | name="tabpy", |
||
| 22 | version=read("tabpy/VERSION"), |
||
| 23 | description=DOCLINES[0], |
||
| 24 | long_description="\n".join(DOCLINES[1:]) + "\n" + read("CHANGELOG"), |
||
| 25 | long_description_content_type="text/markdown", |
||
| 26 | url="https://github.com/tableau/TabPy", |
||
| 27 | author="Tableau", |
||
| 28 | author_email="[email protected]", |
||
| 29 | maintainer="Tableau", |
||
| 30 | maintainer_email="[email protected]", |
||
| 31 | download_url="https://pypi.org/project/tabpy", |
||
| 32 | project_urls={ |
||
| 33 | "Bug Tracker": "https://github.com/tableau/TabPy/issues", |
||
| 34 | "Documentation": "https://tableau.github.io/TabPy/", |
||
| 35 | "Source Code": "https://github.com/tableau/TabPy", |
||
| 36 | }, |
||
| 37 | classifiers=[ |
||
| 38 | "Development Status :: 5 - Production/Stable", |
||
| 39 | "Intended Audience :: Developers", |
||
| 40 | "Intended Audience :: Science/Research", |
||
| 41 | "License :: OSI Approved :: MIT License", |
||
| 42 | "Programming Language :: Python :: 3.9", |
||
| 43 | "Programming Language :: Python :: 3.10", |
||
| 44 | "Programming Language :: Python :: 3.11", |
||
| 45 | "Programming Language :: Python :: 3.12", |
||
| 46 | "Topic :: Scientific/Engineering", |
||
| 47 | "Topic :: Scientific/Engineering :: Information Analysis", |
||
| 48 | "Operating System :: Microsoft :: Windows", |
||
| 49 | "Operating System :: POSIX", |
||
| 50 | "Operating System :: Unix", |
||
| 51 | "Operating System :: MacOS", |
||
| 52 | ], |
||
| 53 | platforms=["Windows", "Linux", "Mac OS-X", "Unix"], |
||
| 54 | keywords=["tabpy tableau"], |
||
| 55 | packages=find_packages(exclude=["docs", "misc"]), |
||
| 56 | package_data={ |
||
| 57 | "tabpy": [ |
||
| 58 | "VERSION", |
||
| 59 | "tabpy_server/state.ini.template", |
||
| 60 | "tabpy_server/static/*", |
||
| 61 | "tabpy_server/common/default.conf", |
||
| 62 | ] |
||
| 63 | }, |
||
| 64 | python_requires=">=3.7", |
||
| 65 | license="MIT", |
||
| 66 | # Note: many of these required packages are included in base python |
||
| 67 | # but are listed here because different linux distros use custom |
||
| 68 | # python installations. And users can remove packages at any point |
||
| 69 | install_requires=[ |
||
| 70 | "cloudpickle", |
||
| 71 | "configparser", |
||
| 72 | "coverage", |
||
| 73 | "coveralls", |
||
| 74 | "docopt", |
||
| 75 | "future", |
||
| 76 | "genson", |
||
| 77 | "hypothesis", |
||
| 78 | "jsonschema", |
||
| 79 | "mock", |
||
| 80 | "nltk", |
||
| 81 | "numpy", |
||
| 82 | "pandas", |
||
| 83 | "pyopenssl", |
||
| 84 | "pytest", |
||
| 85 | "pytest-cov", |
||
| 86 | "requests", |
||
| 87 | "scipy", |
||
| 88 | "simplejson", |
||
| 89 | "scikit-learn", |
||
| 90 | "textblob", |
||
| 91 | "tornado", |
||
| 92 | "twisted", |
||
| 93 | "urllib3", |
||
| 94 | "pyarrow", |
||
| 95 | ], |
||
| 96 | entry_points={ |
||
| 97 | "console_scripts": [ |
||
| 98 | "tabpy=tabpy.tabpy:main", |
||
| 99 | "tabpy-deploy-models=tabpy.models.deploy_models:main", |
||
| 100 | "tabpy-user=tabpy.utils.tabpy_user:main", |
||
| 101 | ], |
||
| 102 | }, |
||
| 103 | setup_requires=["pytest-runner"], |
||
| 104 | test_suite="pytest", |
||
| 105 | ) |
||
| 110 |