Skip to content

Commit

Permalink
pin dependency versions, removing tensor2tensor and copying over thei…
Browse files Browse the repository at this point in the history
…r fork of the deprecated tf.contrib.training.HParams, and fix a few test & lint issues

PiperOrigin-RevId: 464283071
  • Loading branch information
iansimon authored and Magenta Team committed Jul 30, 2022
1 parent 83a472b commit 117c382
Show file tree
Hide file tree
Showing 9 changed files with 700 additions and 40 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
sudo apt-get -y install ffmpeg build-essential libasound2-dev libjack-dev sox
pip install -e .[test]
- name: Test with pytest
run: pytest
run: pytest --ignore=magenta/models/score2perf
- name: Lint with pylint
run: pylint magenta
# The below step just reports the success or failure of tests as a "commit status".
Expand Down
3 changes: 3 additions & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ disable=abstract-method,
c-extension-no-member,
consider-using-enumerate,
consider-using-f-string, # added
consider-using-generator, # added
consider-using-in, # added
consider-using-max-builtin, # added
consider-using-min-builtin, # added
Expand Down Expand Up @@ -146,6 +147,8 @@ disable=abstract-method,
unbalanced-tuple-unpacking, # added
unichr-builtin,
unicode-builtin,
unnecessary-dunder-call, # added
unnecessary-lambda-assignment, # added
unnecessary-pass,
unpacking-in-except,
unsubscriptable-object, # added
Expand Down
27 changes: 27 additions & 0 deletions conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Copyright 2022 The Magenta Authors.
#
# 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.

"""Parse flags when using pytest, which imports tests instead of running."""

import sys

from absl import flags
import pytest


@pytest.fixture(scope='session', autouse=True)
def parse_flags():
# Only pass the first item, because pytest flags shouldn't be parsed as absl
# flags.
flags.FLAGS(sys.argv[:1])
Loading

0 comments on commit 117c382

Please sign in to comment.