Skip to content
This repository was archived by the owner on Oct 21, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[run]
branch = True
omit = *.nox/*
*/test_*.py
nox.py
*/setup.py

[report]
fail_under = 100
show_missing = True
exclude_lines =
# Re-enable the standard pragma
pragma: NO COVER
# Ignore debug-only repr
def __repr__
omit = *.nox/*
*/test_*.py
nox.py
*/setup.py
5 changes: 3 additions & 2 deletions compatibility_lib/compatibility_lib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.

try:

try: #pragma: NO COVER
import pkg_resources
pkg_resources.declare_namespace(__name__)
except ImportError:
except ImportError: #pragma: NO COVER
import pkgutil
__path__ = pkgutil.extend_path(__path__, __name__)
12 changes: 4 additions & 8 deletions compatibility_lib/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,25 @@

import setuptools

with open("README.rst", "r") as fh:
long_description = fh.read()


namespaces = ['compatibility_lib']


setuptools.setup(
name="compatibility_lib",
version="0.0.1",
author="Cloud Python",
author_email="lyh1228@outlook.com",
description="A library to get and store the dependency compatibility status"
"data to BigQuery.",
long_description=long_description,
long_description=open('README.rst').read(),
license="Apache-2.0",
include_package_data=True,
url="https://github.com/GoogleCloudPlatform/cloud-opensource-python/tree/master/compatibility_lib",
packages=setuptools.find_packages(),
namespace_packages=namespaces,
classifiers=(
classifiers=[
"Intended Audience :: Developers",
"Development Status :: 3 - Alpha",
"Programming Language :: Python :: 3",
"License :: OSI Approved :: Apache Software License",
),
],
)
43 changes: 29 additions & 14 deletions nox.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@

from __future__ import absolute_import

import os

import nox

LINT_UNIT_DIR = ['compatibility_server', '.']
Expand Down Expand Up @@ -57,24 +55,41 @@ def unit(session, py):
session.run(
'py.test',
'--quiet',
'--cov={}'.format('compatibility_lib'),
'--cov-append',
'--cov-config=.coveragerc',
'--cov-report=',
'--cov-fail-under=97',
*LINT_UNIT_DIR,
*session.posargs
)


@nox.session
def update_dashboard(session):
"""Build the dashboard."""

def cover(session):
"""Run the final coverage report.
This outputs the coverage report aggregating coverage from the unit
test runs (not system test runs), and then erases coverage data.
"""
session.interpreter = 'python3.6'
session.install('-e', ','.join(LOCAL_DEPS))
session.install('-r', 'requirements-test.txt')

# Set the virtualenv dirname.
session.virtualenv_dirname = 'dashboard'
session.install('coverage', 'pytest-cov')
session.run('coverage', 'report', '--show-missing', '--fail-under=100')
session.run('coverage', 'erase')

session.chdir(os.path.realpath(os.path.dirname(__file__)))

# Build the dashboard!
session.run(
'bash', os.path.join('.', 'scripts', 'update_dashboard.sh'))
# @nox.session
# def update_dashboard(session):
# """Build the dashboard."""
#
# session.interpreter = 'python3.6'
# session.install('-e', ','.join(LOCAL_DEPS))
# session.install('-r', 'requirements-test.txt')
#
# # Set the virtualenv dirname.
# session.virtualenv_dirname = 'dashboard'
#
# session.chdir(os.path.realpath(os.path.dirname(__file__)))
#
# # Build the dashboard!
# session.run(
# 'bash', os.path.join('.', 'scripts', 'update_dashboard.sh'))
1 change: 1 addition & 0 deletions requirements-test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ google-cloud-bigquery==1.3.0
Jinja2==2.10
mock==2.0.0
pytest==3.6.1
pytest-cov==2.5.1
retrying==1.3.3