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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lint setup.py #11167

Merged
merged 1 commit into from Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion pyproject.toml
Expand Up @@ -20,7 +20,6 @@ target-version = "py38"
force-exclude = true
extend-include = ["*.ipynb"]
extend-exclude = [
"setup.py",
"examples/recipes",
"mlflow/protos",
"mlflow/ml_package_versions.py",
Expand Down
19 changes: 12 additions & 7 deletions setup.py
@@ -1,8 +1,9 @@
import os
import logging
from pathlib import Path
import os
from importlib.machinery import SourceFileLoader
from setuptools import setup, find_packages, Command
from pathlib import Path

from setuptools import find_packages, setup

_MLFLOW_SKINNY_ENV_VAR = "MLFLOW_SKINNY"

Expand Down Expand Up @@ -74,7 +75,7 @@ def remove_comments_and_empty_lines(lines):
GATEWAY_REQUIREMENTS = remove_comments_and_empty_lines(f.read().splitlines())

_is_mlflow_skinny = bool(os.environ.get(_MLFLOW_SKINNY_ENV_VAR))
logging.debug("{} env var is set: {}".format(_MLFLOW_SKINNY_ENV_VAR, _is_mlflow_skinny))
logging.debug(f"{_MLFLOW_SKINNY_ENV_VAR} env var is set: {_is_mlflow_skinny}")

MINIMUM_SUPPORTED_PYTHON_VERSION = Path("requirements", "python-version.txt").read_text().strip()

Expand All @@ -87,6 +88,12 @@ def remove_comments_and_empty_lines(lines):
*recipes_files,
]

with open("README_SKINNY.rst") as f:
README_SKINNY = f.read()

with open("README.rst") as f:
README = f.read()

setup(
name="mlflow" if not _is_mlflow_skinny else "mlflow-skinny",
version=version,
Expand Down Expand Up @@ -162,9 +169,7 @@ def remove_comments_and_empty_lines(lines):
zip_safe=False,
author="Databricks",
description="MLflow: A Platform for ML Development and Productionization",
long_description=open("README.rst").read()
if not _is_mlflow_skinny
else open("README_SKINNY.rst").read() + open("README.rst").read(),
long_description=README if not _is_mlflow_skinny else README_SKINNY + README,
long_description_content_type="text/x-rst",
license="Apache License 2.0",
classifiers=[
Expand Down
3 changes: 1 addition & 2 deletions tests/resources/mlflow-test-plugin/setup.py
@@ -1,5 +1,4 @@
from setuptools import setup, find_packages

from setuptools import find_packages, setup

setup(
name="mlflow-test-plugin",
Expand Down