-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
34 changed files
with
117 additions
and
220 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
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,4 +1,4 @@ | ||
name: docker - Build, Lint, and Test | ||
name: docker - Build Lint and Test | ||
|
||
on: | ||
push: | ||
|
@@ -11,20 +11,17 @@ jobs: | |
runs-on: ubuntu-latest | ||
env: | ||
IMAGE_TAG: ${{ github.sha }} | ||
|
||
steps: | ||
- name: Checkout git repo | ||
uses: actions/checkout@v3 | ||
- uses: jpribyl/[email protected] | ||
# Ignore the failure of a step and avoid terminating the job. | ||
continue-on-error: true | ||
uses: actions/checkout@v4 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
uses: docker/setup-buildx-action@v3 | ||
with: | ||
install: true | ||
- name: Build and install | ||
run: docker build --load -t precovery:$IMAGE_TAG . | ||
- name: Build | ||
run: docker build --load -t difi:$IMAGE_TAG . | ||
- name: Lint | ||
run: docker run -i precovery:$IMAGE_TAG pre-commit run --all-files | ||
run: docker run -i difi:$IMAGE_TAG pdm lint | ||
- name: Test | ||
run: docker run -i precovery:$IMAGE_TAG pytest . --cov | ||
run: docker run -i difi:$IMAGE_TAG pdm test |
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 @@ | ||
name: pip - Build, Lint, Test, and Coverage | ||
name: pip - Build Lint Test and Coverage | ||
|
||
on: | ||
push: | ||
|
@@ -12,30 +12,32 @@ jobs: | |
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
python-version: ['3.8', '3.9', '3.10', '3.11'] | ||
python-version: ["3.10"] | ||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
|
||
steps: | ||
- name: Checkout git repo | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
- name: Get git tags | ||
run: git fetch --prune --unshallow --tags | ||
- name: Set up miniconda | ||
uses: conda-incubator/setup-miniconda@v2 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
activate-environment: "difi" | ||
auto-update-conda: true | ||
python-version: ${{ matrix.python-version }} | ||
- name: Build and install | ||
run: pip install .[tests] | ||
cache: 'pip' # caching pip dependencies | ||
- 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 }} | ||
path-to-lcov: coverage.xml | ||
path-to-lcov: coverage.xml |
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,25 +1,16 @@ | ||
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 | ||
|
||
# Install system dependencies | ||
RUN apt-get install -y git python3 python3-pip python3-dev | ||
|
||
# Upgrade pip to the latest version and install pre-commit | ||
RUN pip install --upgrade pip pre-commit | ||
|
||
# Install pre-commit hooks (before difi is installed to cache this step) | ||
# Remove the .git directory after pre-commit is installed as difi's .git | ||
# will be added to the container | ||
RUN mkdir /code/ | ||
COPY .pre-commit-config.yaml /code/ | ||
WORKDIR /code/ | ||
RUN git init . \ | ||
&& pre-commit install-hooks \ | ||
&& rm -rf .git | ||
&& apt-get upgrade -y \ | ||
&& apt-get install -y pip git | ||
|
||
# Install difi | ||
RUN mkdir -p /code/ | ||
WORKDIR /code/ | ||
ADD . /code/ | ||
RUN pip install -e .[tests] | ||
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
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 difi/*.py | ||
include src/*.py | ||
include *.md | ||
include *.toml | ||
exclude Dockerfile | ||
|
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,13 +1,6 @@ | ||
[build-system] | ||
requires = ["setuptools>=45", "wheel", "setuptools_scm[toml]>=6.0"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[tool.setuptools_scm] | ||
write_to = "difi/version.py" | ||
write_to_template = "__version__ = '{version}'" | ||
|
||
[project] | ||
name = "difi" | ||
dynamic = ["version"] | ||
authors = [ | ||
{name = "Joachim Moeyens", email = "[email protected]"}, | ||
] | ||
|
@@ -17,62 +10,93 @@ maintainers = [ | |
description = "Did I Find It?" | ||
readme = "README.md" | ||
license = {file = "LICENSE.md"} | ||
keywords = [ | ||
"astronomy", | ||
"astrophysics", | ||
"space", | ||
"science", | ||
"asteroids", | ||
"comets", | ||
"solar system" | ||
] | ||
requires-python = ">=3.10" | ||
classifiers = [ | ||
"Development Status :: 3 - Alpha", | ||
"Intended Audience :: Science/Research", | ||
"License :: OSI Approved :: BSD License", | ||
"Operating System :: OS Independent", | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.12", | ||
"Topic :: Scientific/Engineering :: Astronomy", | ||
"Topic :: Scientific/Engineering :: Physics", | ||
] | ||
requires-python = ">=3.8" | ||
keywords = [ | ||
"astronomy", | ||
"astrophysics", | ||
"space", | ||
"science", | ||
"asteroids", | ||
"comets", | ||
"solar system" | ||
] | ||
|
||
dependencies = [ | ||
"numba", | ||
"numpy", | ||
"pandas", | ||
] | ||
dynamic = ["version"] | ||
|
||
[project.urls] | ||
homepage = "https://github.com/moeyensj/difi" | ||
repository = "https://github.com/moeyensj/difi" | ||
[build-system] | ||
requires = ["pdm-backend"] | ||
build-backend = "pdm.backend" | ||
[tool.pdm.build] | ||
includes = ["src/difi/"] | ||
|
||
[project.optional-dependencies] | ||
tests = [ | ||
"pytest", | ||
"pytest-cov", | ||
"pytest-benchmark", | ||
"pre-commit", | ||
] | ||
[tool.pdm.version] | ||
source = "scm" | ||
write_to = "src/difi/_version.py" | ||
write_template = "__version__ = '{}'" | ||
|
||
[tool.pytest.ini_options] | ||
addopts = ["--benchmark-skip"] | ||
[tool.pdm.scripts] | ||
check = { composite = ["lint", "typecheck", "test"] } | ||
format = { composite = ["black ./src/difi", "isort ./src/difi"] } | ||
lint = { composite = [ | ||
"ruff check ./src/difi", | ||
"black --check ./src/difi", | ||
"isort --check-only ./src/difi", | ||
] } | ||
fix = "ruff ./src/difi --fix" | ||
typecheck = "mypy --strict ./src/difi" | ||
|
||
[tool.setuptools] | ||
include-package-data = true | ||
test = "pytest --benchmark-disable {args}" | ||
doctest = "pytest --doctest-plus --doctest-only" | ||
benchmark = "pytest --benchmark-only" | ||
coverage = "pytest --cov=difi --cov-report=xml" | ||
|
||
[tool.setuptools.packages.find] | ||
include = ['difi*'] | ||
[project.urls] | ||
"Documentation" = "https://github.com/moeyensj/difi#README.md" | ||
"Issues" = "https://github.com/moeyensj/difi/issues" | ||
"Source" = "https://github.com/moeyensj/difi" | ||
|
||
[tool.setuptools.package-data] | ||
difi = ["tests/*.txt"] | ||
[project.optional-dependencies] | ||
dev = [ | ||
"black", | ||
"ipython", | ||
"isort", | ||
"mypy", | ||
"pdm", | ||
"pytest-benchmark", | ||
"pytest-cov", | ||
"pytest-doctestplus", | ||
"pytest-mock", | ||
"pytest", | ||
"ruff", | ||
] | ||
|
||
[tool.black] | ||
line-length = 110 | ||
|
||
[tool.isort] | ||
profile = "black" | ||
|
||
[tool.ruff] | ||
line-length = 110 | ||
target-version = "py311" | ||
lint.ignore = [] | ||
exclude = ["build"] | ||
|
||
[tool.mypy] | ||
ignore_missing_imports = true |
Oops, something went wrong.