Skip to content

Commit

Permalink
Merge pull request #111 from lsst/tickets/DM-33403
Browse files Browse the repository at this point in the history
DM-33403: Move base.Packages to lsst.utils
  • Loading branch information
timj committed Jan 31, 2022
2 parents 517bd56 + c8ff301 commit 63a1f4f
Show file tree
Hide file tree
Showing 14 changed files with 1,744 additions and 11 deletions.
44 changes: 37 additions & 7 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,54 @@ jobs:
with:
python-version: 3.8

- name: Update pip/wheel infrastructure
- uses: conda-incubator/setup-miniconda@v2
with:
python-version: 3.8
channels: conda-forge,defaults
channel-priority: strict
show-channel-urls: true

- name: Install eups and any other conda packages
shell: bash -l {0}
run: |
python -m pip install --upgrade pip
pip install wheel
conda install -y -q eups conda
# We have two cores so we can speed up the testing with xdist
- name: Install pytest packages
shell: bash -l {0}
run: conda install -y -q pytest pytest-flake8 pytest-xdist pytest-openfiles pytest-cov

- name: Install dependencies
shell: bash -l {0}
run: |
pip install -r requirements.txt
# We have two cores so we can speed up the testing with xdist
- name: Install pytest packages
run: pip install pytest pytest-flake8 pytest-xdist pytest-openfiles pytest-cov
- name: List installed packages
shell: bash -l {0}
run: |
conda list
pip list -v
- name: Build and install
shell: bash -l {0}
run: pip install -v -e .

- name: Setup EUPS test package
shell: bash -l {0}
run: |
mkdir -p test_package/ups
touch test_package/ups/test_package.table
mkdir test_package/.git
cp -r .git test_package/.git/
- name: Run tests
run: pytest -r a -v -n 3 --open-files --cov=tests --cov=lsst.utils --cov-report=xml --cov-report=term
shell: bash -l {0}
run: |
cd test_package
setup -k -r .
cd -
eups list
pytest -r a -v -n 3 --open-files --cov=tests --cov=lsst.utils --cov-report=xml --cov-report=term
- name: Upload coverage to codecov
uses: codecov/codecov-action@v2
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/mypy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ jobs:
python-version: 3.8

- name: Install
# pin mypy to fix a compatibility issue between mypy 0.92 and pedantic
run: pip install "mypy==0.910" pydantic
run: pip install mypy pydantic

- name: Install third party stubs
run: pip install types-requests types-PyYAML types-click types-pkg_resources types-Deprecated
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 21.11b1
rev: 22.1.0
hooks:
- id: black
# It is recommended to specify the latest version of Python
Expand Down
2 changes: 2 additions & 0 deletions doc/changes/DM-33403.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
A new package `lsst.utils.packages` has been added to allow system package versions to be obtained.
This code has been relocated from ``lsst.base``.
2 changes: 2 additions & 0 deletions doc/lsst.utils/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,5 @@ Python API reference
:no-main-docstr:
.. automodapi:: lsst.utils.timer
:no-main-docstr:
.. automodapi:: lsst.utils.packages
:no-main-docstr:
8 changes: 7 additions & 1 deletion mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ ignore_errors = True
ignore_missing_imports = True
ignore_errors = True

[mypy-eups.*]
ignore_missing_imports = True

[mypy-conda.cli.*]
ignore_missing_imports = True

[mypy-lsst.*]
ignore_missing_imports = True
ignore_errors = True
Expand Down Expand Up @@ -50,7 +56,7 @@ ignore_errors = True

# Can be removed when typeshed releases update for deprecated package.
[mypy-lsst.utils.deprecated.*]
ignore_errors = True
ignore_errors = False

# version.py is added by scons and may not exist when we run mypy.
[mypy-lsst.utils.version]
Expand Down

0 comments on commit 63a1f4f

Please sign in to comment.