From b4c1fed6ed9fe8219247ec4bf9c7d679eb2e3116 Mon Sep 17 00:00:00 2001 From: Aiden Grossman Date: Fri, 26 Jan 2024 22:35:52 -0800 Subject: [PATCH] Remove infrastructure for publishing ml-compiler-opt as a package (#336) This patch removes infrastructure for publishing ml-compiler-opt as a package. This is no longer needed now as all of the core components that are intended for downstream use are upstream within the LLVM monorepo. Packages are already published under the `mlgo-utils` name. --- .github/workflows/main.yml | 68 --------------------------------- .github/workflows/packaging.yml | 31 --------------- .gitignore | 5 --- compiler_opt/package_config.py | 19 --------- pyproject.toml | 24 ------------ 5 files changed, 147 deletions(-) delete mode 100644 .github/workflows/main.yml delete mode 100644 .github/workflows/packaging.yml delete mode 100644 compiler_opt/package_config.py delete mode 100644 pyproject.toml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index 26a70ea0..00000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,68 +0,0 @@ -# This is a basic workflow to help you get started with Actions - -name: MLGO CI - -on: [push, repository_dispatch, pull_request] - -jobs: - LicenseCheck: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - run: ./check-license.sh - Envvars: - runs-on: ubuntu-latest - outputs: - version_matrix: ${{ steps.set-output.outputs.version_matrix }} - do_cache: ${{ steps.set-output.outputs.do_cache }} - steps: - - id: set-output - run: | - if [ -z $ACT ] - then - _ver="['3.8', '3.9', '3.10']" - _cache="1" - else - # 3.8 instead of '3.8' to make github act work. - _ver="[3.8]" - _cache="0" - fi - echo "version_matrix=$_ver" >> $GITHUB_OUTPUT - echo "do_cache=$_cache" >> $GITHUB_OUTPUT - Checks: - runs-on: ubuntu-latest - needs: [Envvars] - strategy: - matrix: - python-version: ${{ fromJSON(needs.Envvars.outputs.version_matrix) }} - task: [Typecheck, Lint, Yapf, Test] - include: - - task: Typecheck - cmd: pytype -j auto --overriding-parameter-count-checks . - - task: Lint - cmd: pylint --rcfile .pylintrc --recursive yes . - - task: Yapf - cmd: yapf . -drp - - task: Test - cmd: pytest - steps: - - uses: actions/checkout@v3 - - name: Install Python With Cached pip Packages - if: needs.Envvars.outputs.do_cache == '1' - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - cache: 'pipenv' - cache-dependency-path: Pipfile.lock - - name: Install Python, no cache - if: needs.Envvars.outputs.do_cache == '0' - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - name: Install Pipenv - run: pip3 install pipenv - - name: Install Python Dependencies - run: pipenv sync --categories="packages dev-packages ci" --verbose - - name: ${{ matrix.task }} - run: pipenv run ${{ matrix.cmd }} - diff --git a/.github/workflows/packaging.yml b/.github/workflows/packaging.yml deleted file mode 100644 index 0be85db8..00000000 --- a/.github/workflows/packaging.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: MLGO Packaging CI - -on: - workflow_dispatch: - schedule: - - cron: '0 0 * * *' - -jobs: - BuildAndPublich: - runs-on: ubuntu-latest - name: Build and Publish Package - steps: - - uses: actions/checkout@v3 - name: Checkout repository - - uses: actions/setup-python@v4 - name: Setup Python - with: - python-version: '3.10' - cache: 'pip' - - run: pip3 install build==0.10.0 setuptools==68.0.00 twine==4.0.2 - name: Install Packaging Dependencies - # TODO(boomanaiden154): Switch this install step over to using pipenv - # once regenerating the lockfile has been fixed. - - run: python3 -m build - name: Build package - - run: twine upload dist/* - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{secrets.PYPI_TOKEN}} - name: Publish the package - if: ${{github.repository_owner == 'google' && github.ref_name == 'main'}} diff --git a/.gitignore b/.gitignore index bbcb6b82..c7e97008 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,3 @@ __pycache__ .vscode .idea - -# Python packaging build directories -build/* -dist/* -ml_compiler_opt.egg-info/* diff --git a/compiler_opt/package_config.py b/compiler_opt/package_config.py deleted file mode 100644 index 2b61bd00..00000000 --- a/compiler_opt/package_config.py +++ /dev/null @@ -1,19 +0,0 @@ -# coding=utf-8 -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -"""Setup version information for the package.""" - -from datetime import timezone, datetime - -__version__ = '0.0.1.dev' + datetime.now(tz=timezone.utc).strftime('%Y%m%d%H%M') diff --git a/pyproject.toml b/pyproject.toml deleted file mode 100644 index e9032ea3..00000000 --- a/pyproject.toml +++ /dev/null @@ -1,24 +0,0 @@ -[build-system] -requires = ["setuptools"] -build-backend = "setuptools.build_meta" - -[project] -name = "ml-compiler-opt" -description = "Tooling for ML in LLVM" -readme = "README.md" -requires-python = ">=3.8,<3.11" -dependencies = [ - "absl-py>=1.0.0", - "gin-config>=0.5.0", - "psutil>=5.9.0", - "tf-agents>=0.16.0", - "tensorflow>=2.12.0", - "dm-reverb>=0.11.0" -] -dynamic = ["version"] - -[tool.setuptools.packages.find] -include = ["compiler_opt*"] - -[tool.setuptools.dynamic] -version = {attr = "compiler_opt.package_config.__version__"}