-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Swap to pdm #166
Merged
Swap to pdm #166
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
7e0a711
Swap to pdm
moeyensj 61419c6
Update CI scripts to use pdm
moeyensj b4f8fd4
Lint all files
moeyensj a46fe90
Use quivr's drop_duplicates
moeyensj 4ac6449
Remove conda build recipe and publish workflow
moeyensj 491d82a
Upgrade adam_core >= 0.2.5
moeyensj File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
This file was deleted.
Oops, something went wrong.
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
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
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 |
---|---|---|
|
@@ -16,38 +16,36 @@ jobs: | |
defaults: | ||
run: | ||
shell: bash -l {0} | ||
env: | ||
OORB_DATA: /tmp/oorb/data | ||
|
||
steps: | ||
- name: Checkout git repo | ||
uses: actions/checkout@v4 | ||
- name: Get git tags | ||
run: git fetch --prune --unshallow --tags | ||
- name: Set up miniconda | ||
uses: conda-incubator/setup-miniconda@v3 | ||
with: | ||
activate-environment: "thor" | ||
auto-update-conda: true | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install openorb using conda | ||
run: conda install -c defaults -c conda-forge openorb --yes | ||
- name: Update OBSCODE.dat | ||
run: | | ||
cd $CONDA_PREFIX/share/oorb | ||
curl https://www.minorplanetcenter.net/iau/lists/ObsCodes.html -o ObsCodes.html | ||
sed -e '2d' ObsCodes.html | grep -v "<" > OBSCODE.dat | ||
rm -f ObsCodes.html | ||
cp OBSCODE.dat $CONDA_PREFIX/share/openorb/OBSCODE.dat | ||
- uses: actions/setup-python@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: 'pip' # caching pip dependencies | ||
- name: Build and install | ||
run: pip install .[tests] | ||
- name: Install openorb dependencies | ||
run: | | ||
sudo apt-get update -y | ||
sudo apt-get install -y gfortran liblapack-dev | ||
wget -P /tmp/ https://storage.googleapis.com/oorb-data/oorb_data.tar.gz | ||
mkdir -p /tmp/oorb/ | ||
tar -xvf /tmp/oorb_data.tar.gz -C /tmp/oorb/ | ||
- name: Install Dependencies | ||
run: | | ||
pip install pip --upgrade | ||
pip install ".[dev]" | ||
- name: Lint | ||
run: pre-commit run --all-files | ||
- name: Test | ||
run: pytest . --cov --cov-report xml | ||
- name: Coverage | ||
run: pdm run lint | ||
# - name: Type check | ||
# run: pdm run typecheck | ||
- name: Test with coverage | ||
run: pdm run coverage | ||
- name: Coverage Report | ||
uses: coverallsapp/[email protected] | ||
with: | ||
github-token: ${{ secrets.COVERALLS_TOKEN }} | ||
|
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
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,56 +1,22 @@ | ||
FROM ubuntu:latest | ||
FROM python:3.11 | ||
|
||
# Set shell to bash | ||
SHELL ["/bin/bash", "-c"] | ||
CMD ["/bin/bash"] | ||
|
||
# Update system dependencies | ||
RUN apt-get update \ | ||
&& apt-get upgrade -y \ | ||
&& apt-get install -y curl gfortran git liblapack-dev make pip python3.11 python-is-python3 unzip wget | ||
&& apt-get install -y pip git wget tar gfortran liblapack-dev | ||
|
||
# Upgrade pip to the latest version and install pre-commit | ||
RUN pip install --upgrade pip pre-commit | ||
RUN pip install --upgrade cython==0.29.36 setuptools setuptools_scm | ||
RUN chmod 777 /opt | ||
|
||
# Install numpy | ||
RUN git clone https://github.com/numpy/numpy.git /opt/numpy | ||
RUN cd /opt/numpy && git checkout v1.24.4 && git submodule update --init | ||
RUN cd /opt/numpy && python3 setup.py build --cpu-baseline=native install | ||
|
||
|
||
# Install openorb | ||
# TODO: We need a more robust way to be appropriately natively compiled pyoorb installed | ||
# including data file generation | ||
RUN git clone https://github.com/B612-Asteroid-Institute/oorb.git /opt/oorb | ||
RUN cd /opt/oorb && git checkout fork | ||
RUN cd /opt/oorb && ./configure gfortran opt --with-pyoorb --with-f2py=/usr/local/bin/f2py --with-python=python3 | ||
# Add '-march=native' to compiler options by running a sed | ||
# script directly on the Makefile.includse file. This is a | ||
# hack to get around the fact that the configure script | ||
# doesn't support this option. | ||
RUN sed -i 's/FCOPTIONS = .*/FCOPTIONS = $(FCOPTIONS_OPT_GFORTRAN) -march=native/g' /opt/oorb/Makefile.include | ||
# --no-build-isolation is needed because we need to ensure we use | ||
# the same version of numpy as the one we compiled previously so | ||
# that it matches the version of f2py we passed in to ./configure. | ||
RUN pip install --no-build-isolation -v /opt/oorb | ||
|
||
# Generate the data files | ||
RUN cd /opt/oorb && make ephem | ||
RUN cd /opt/oorb/data && ./getBC430 | ||
RUN cd /opt/oorb/data && ./updateOBSCODE | ||
ENV OORBROOT=/opt/oorb | ||
ENV OORB_DATA=/opt/oorb/data | ||
|
||
# Install pre-commit hooks (before THOR is installed to cache this step) | ||
RUN mkdir /code/ | ||
COPY .pre-commit-config.yaml /code/ | ||
WORKDIR /code/ | ||
RUN git init . \ | ||
&& git add .pre-commit-config.yaml \ | ||
&& pre-commit install-hooks \ | ||
&& rm -rf .git | ||
# Install openorb dependencies | ||
RUN wget -P /tmp/ https://storage.googleapis.com/oorb-data/oorb_data.tar.gz \ | ||
&& mkdir -p /tmp/oorb/ \ | ||
&& tar -xvf /tmp/oorb_data.tar.gz -C /tmp/oorb/ | ||
ENV OORB_DATA=/tmp/oorb/data/ | ||
|
||
# Install THOR | ||
RUN mkdir -p /code/ | ||
WORKDIR /code/ | ||
ADD . /code/ | ||
RUN SETUPTOOLS_SCM_PRETEND_VERSION=1 pip install -e .[tests,dev] | ||
RUN pip install -e .[dev] |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
include thor/*.py | ||
include src/*.py | ||
include *.md | ||
include *.toml | ||
include *.yaml |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can dump the docker builds altogether with the simpler pyoorb / numpy install?