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

Pin Python to 3.9 for statsmodels dev version #10771

Merged
merged 4 commits into from
Jan 3, 2024

Conversation

B-Step62
Copy link
Collaborator

@B-Step62 B-Step62 commented Jan 3, 2024

🛠 DevTools 🛠

Open in GitHub Codespaces

Install mlflow from this PR

pip install git+https://github.com/mlflow/mlflow.git@refs/pull/10771/merge

Checkout with GitHub CLI

gh pr checkout 10771

What changes are proposed in this pull request?

Statsmodels dev version requires Python 3.9 (commit).

Hardcoded Python version in cross-version test to 3.9 and also moved logic to Python script to avoid further complication.

How is this PR tested?

  • Existing unit/integration tests
  • New unit/integration tests
  • Manual tests

Validated cross version tests passed with dev version using dummy commit.

Does this PR require documentation update?

  • No. You can skip the rest of this section.
  • Yes. I've updated:
    • Examples
    • API references
    • Instructions

Release Notes

Is this a user-facing change?

  • No. You can skip the rest of this section.
  • Yes. Give a description of this change to be included in the release notes for MLflow users.

What component(s), interfaces, languages, and integrations does this PR affect?

Components

  • area/artifacts: Artifact stores and artifact logging
  • area/build: Build and test infrastructure for MLflow
  • area/deployments: MLflow Deployments client APIs, server, and third-party Deployments integrations
  • area/docs: MLflow documentation pages
  • area/examples: Example code
  • area/model-registry: Model Registry service, APIs, and the fluent client calls for Model Registry
  • area/models: MLmodel format, model serialization/deserialization, flavors
  • area/recipes: Recipes, Recipe APIs, Recipe configs, Recipe Templates
  • area/projects: MLproject format, project running backends
  • area/scoring: MLflow Model server, model deployment tools, Spark UDFs
  • area/server-infra: MLflow Tracking server backend
  • area/tracking: Tracking Service, tracking client APIs, autologging

Interface

  • area/uiux: Front-end, user experience, plotting, JavaScript, JavaScript dev server
  • area/docker: Docker use across MLflow's components, such as MLflow Projects and MLflow Models
  • area/sqlalchemy: Use of SQLAlchemy in the Tracking Service or Model Registry
  • area/windows: Windows support

Language

  • language/r: R APIs and clients
  • language/java: Java APIs and clients
  • language/new: Proposals for new client languages

Integrations

  • integrations/azure: Azure and Azure ML integrations
  • integrations/sagemaker: SageMaker integrations
  • integrations/databricks: Databricks integrations

How should the PR be classified in the release notes? Choose one:

  • rn/none - No description will be included. The PR will be mentioned only by the PR number in the "Small Bugfixes and Documentation Updates" section
  • rn/breaking-change - The PR will be mentioned in the "Breaking Changes" section
  • rn/feature - A new user-facing feature worth mentioning in the release notes
  • rn/bug-fix - A user-facing bug fix worth mentioning in the release notes
  • rn/documentation - A user-facing documentation change worth mentioning in the release notes

@B-Step62 B-Step62 added the enable-dev-tests Enables cross-version tests for dev versions label Jan 3, 2024
Copy link

github-actions bot commented Jan 3, 2024

Documentation preview for b820741 will be available here when this CircleCI job completes successfully.

More info

@github-actions github-actions bot added area/build Build and test infrastructure for MLflow rn/none List under Small Changes in Changelogs. labels Jan 3, 2024
@B-Step62 B-Step62 requested a review from BenWilson2 January 3, 2024 01:33
@BenWilson2
Copy link
Member

Curious to hear your thoughts on leaving get_requires_python as abstract as possible.

What do you think of adding a param to the function that defines the dev fallback?

def get_requires_python(package: str, version: str, dev_package_fallback_versions: t.Dict[str, str]) -> t.Optional[str]:
    if version == "dev" and package in dev_package_fallback_versions:
        return dev_package_fallback_versions[package]

    resp = requests.get(f"https://pypi.python.org/pypi/{package}/json")
    resp.raise_for_status()
    return next(
        (
            distributions[0].get("requires_python")
            for ver, distributions in resp.json()["releases"].items()
            if ver == version and distributions
        ),
        None,
    )

And then doing something like this to have full control over the versions of dev packages (just so that if some new library decides to jump to Py3.10 for some reason, we're not stuck with bumping all of the versions up?

      - name: Get Python version
        id: get-python-version
        run: |
          DEV_PACKAGE_FALLBACK_VERSIONS='{"tensorflow": ">=3.9", "scikit-learn": ">=3.9", "statsmodels": ">=3.9"}'
          python_version=$(python dev/get_minimum_required_python.py -p ${{ matrix.package }} -v ${{ matrix.version }} --python-versions "3.8,3.9" --dev-package-fallback-versions "$DEV_PACKAGE_FALLBACK_VERSIONS")

@B-Step62
Copy link
Collaborator Author

B-Step62 commented Jan 3, 2024

I agree with having dictionary to allow different versions! But I would hardcode it to Python script rather than args, so we don't have to hop between files. We don't reuse this in multiple shell scripts so it doesn't have to be parameters.

@BenWilson2
Copy link
Member

I agree with having dictionary to allow different versions! But I would hardcode it to Python script rather than args, so we don't have to hop between files. We don't reuse this in multiple shell scripts so it doesn't have to be parameters.

SGTM! Yeah, let's change to a Dict in the .py file as a constant, rename the constant variable to generic "dev" instead of a particular version of python and keep the cleaner new yaml implementation :)

@WeichenXu123
Copy link
Collaborator

I agree with having dictionary to allow different versions! But I would hardcode it to Python script rather than args, so we don't have to hop between files. We don't reuse this in multiple shell scripts so it doesn't have to be parameters.

SGTM! Yeah, let's change to a Dict in the .py file as a constant, rename the constant variable to generic "dev" instead of a particular version of python and keep the cleaner new yaml implementation :)

This suggestion makes sense, let's keep yaml file simple :)

@B-Step62 B-Step62 enabled auto-merge (squash) January 3, 2024 14:28
@BenWilson2 BenWilson2 disabled auto-merge January 3, 2024 15:39
Copy link
Member

@BenWilson2 BenWilson2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for the fix :)

@BenWilson2 BenWilson2 merged commit 8e011d5 into mlflow:master Jan 3, 2024
annzhang-db pushed a commit to annzhang-db/mlflow that referenced this pull request Jan 3, 2024
@B-Step62 B-Step62 deleted the statsmodels branch January 3, 2024 23:46
B-Step62 added a commit to B-Step62/mlflow that referenced this pull request Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/build Build and test infrastructure for MLflow enable-dev-tests Enables cross-version tests for dev versions rn/none List under Small Changes in Changelogs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants