-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
3 changed files
with
97 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: pytest_core | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
test-ubuntu: | ||
name: "pytest on ${{ matrix.python-version }} on ${{ matrix.os }}" | ||
runs-on: "${{ matrix.os }}" | ||
strategy: | ||
matrix: | ||
python-version: [3.9] | ||
os: [ubuntu-latest] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install essential dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install wheel | ||
pip install pytest pytest-xdist | ||
- name: Install package | ||
run: | | ||
pip install -e . | ||
- name: Print installed dependencies | ||
run: | | ||
pip freeze | ||
- name: Test with pytest # (TODO: Automate Iris installation) | ||
run: | | ||
# pytest -n auto iris |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Standard packages. | ||
typing # Version dependent on Python version. | ||
pytest # Use the latest version to match github workflow. | ||
absl-py>=1.0.0 | ||
|
||
# Distributed systems libraries. | ||
dm-launchpad | ||
|
||
# Configuration + Experimentation | ||
ml-collections | ||
|
||
# Numerical packages. | ||
numpy>=1.21.5 | ||
jax # Use latest version. | ||
jaxlib # Use latest version. | ||
flax # Use latest version. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Copyright 2024 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 for pip package.""" | ||
import setuptools | ||
|
||
|
||
def _strip_comments_from_line(s: str) -> str: | ||
"""Parses a line of a requirements.txt file.""" | ||
requirement, *_ = s.split('#') | ||
return requirement.strip() | ||
|
||
|
||
def _parse_requirements(requirements_txt_path: str) -> list[str]: | ||
"""Returns a list of dependencies for setup() from requirements.txt.""" | ||
|
||
with open(requirements_txt_path) as fp: | ||
# Parse comments. | ||
lines = [_strip_comments_from_line(line) for line in fp.read().splitlines()] | ||
# Remove empty lines and direct github repos (not allowed in setup.py) | ||
return [l for l in lines if (l and 'github.com' not in l)] | ||
|
||
|
||
setuptools.setup( | ||
name='google-iris', | ||
version='1.0', | ||
description='Iris', | ||
author='Iris Team', | ||
author_email='[email protected]', | ||
install_requires=_parse_requirements('requirements.txt'), | ||
packages=setuptools.find_packages(), | ||
) |