Skip to content

Commit

Permalink
Swap to pdm (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
moeyensj authored Sep 24, 2024
1 parent 61bd646 commit af813a9
Show file tree
Hide file tree
Showing 22 changed files with 174 additions and 458 deletions.
29 changes: 0 additions & 29 deletions .github/workflows/lint.yaml

This file was deleted.

41 changes: 41 additions & 0 deletions .github/workflows/pip-build-lint-test-coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build Lint Test and Coverage

on:
push:
branches: [ main, "v*"]
pull_request:
branches: [ main, "v*"]

jobs:
build-lint-test-coverage:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11"]
defaults:
run:
shell: bash -l {0}

steps:
- name: Checkout git repo
uses: actions/checkout@v4
- name: Get git tags
run: git fetch --prune --unshallow --tags
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip' # caching pip dependencies
- name: Install Testing Dependencies
run: |
pip install pip --upgrade
pip install ".[dev]"
- name: Lint
run: pdm run lint
- name: Type check
run: pdm run typecheck
- name: Test with coverage
run: pdm run coverage
- name: Coverage report to coveralls
uses: coverallsapp/[email protected]
with:
path-to-lcov: coverage.xml
39 changes: 0 additions & 39 deletions .pre-commit-config.yaml

This file was deleted.

1 change: 0 additions & 1 deletion .python-version

This file was deleted.

9 changes: 9 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
The MIT License (MIT)

Copyright (c) 2023-2024, Asteroid Institute

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# mpcq
#### A Python package by the Asteroid Institute, a program of the B612 Foundation

[![Python 3.10+](https://img.shields.io/badge/Python-3.10%2B-blue)](https://img.shields.io/badge/Python-3.10%2B-blue)
[![License](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![pip - Build, Lint, Test, and Coverage](https://github.com/B612-Asteroid-Institute/mpcq/actions/workflows/pip-build-lint-test-coverage.yml/badge.svg)](https://github.com/B612-Asteroid-Institute/mpcq/actions/workflows/pip-build-lint-test-coverage.yml)

This is a client library for interacting with an MPC observations database.

## Notice
Expand Down
7 changes: 0 additions & 7 deletions mpcq/version.py

This file was deleted.

94 changes: 84 additions & 10 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,32 @@
[project]
name = "mpcq"
dynamic = ["version", "readme"]
requires-python = ">=3.9"
dynamic = ["version"]
authors = [
{ name = "Spencer Nelson", email = "[email protected]" },
{ name = "Nate Tellis", email = "[email protected]" },
{ name = "Alec Koumjian", email = "[email protected]" },
{ name = "Joachim Moeyens", email = "[email protected]" },
]
description = "Client library for interacting with an MPC observations database"
readme = "README.md"
requires-python = ">=3.10"
classifiers = [
"Operating System :: OS Independent",
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Topic :: Scientific/Engineering :: Astronomy",
]
license = { file = "LICENSE.md" }

keywords = ["astronomy", "orbital mechanics", "propagation"]

dependencies = [
"adam_core @ git+https://[email protected]/B612-Asteroid-Institute/adam_core@080aa55d322f417db4bcb580de61e1aaccbe13d6#egg=adam_core",
"sqlalchemy < 2",
"adam_core==0.2.4a1",
"sqlalchemy<2",
"astropy",
"pandas",
"astropy",
"quivr",
Expand All @@ -14,14 +35,67 @@ dependencies = [
"pg8000",
]

[project.optional-dependencies]
tests = ["pre-commit", "pytest", "black", "isort"]

[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"
requires = ["pdm-backend"]
build-backend = "pdm.backend"
[tool.pdm.build]
includes = ["src/mpcq/"]

[tool.pdm.version]
source = "scm"
write_to = "mpcq/_version.py"
write_template = "__version__ = '{}'"


[tool.pdm.scripts]
check = { composite = ["lint", "typecheck", "test"] }
format = { composite = ["black ./src/mpcq", "isort ./src/mpcq"] }
lint = { composite = [
"ruff check ./src/mpcq",
"black --check ./src/mpcq",
"isort --check-only ./src/mpcq",
] }
fix = "ruff ./src/mpcq --fix"
typecheck = "mypy --strict ./src/mpcq"

[tool.setuptools_scm]
test = "pytest --benchmark-disable {args}"
doctest = "pytest --doctest-plus --doctest-only"
benchmark = "pytest --benchmark-only"
coverage = "pytest --cov=mpcq --cov-report=xml"


[project.urls]
"Documentation" = "https://github.com/B612-Asteroid-Institute/mpcq#README.md"
"Issues" = "https://github.com/B612-Asteroid-Institute/mpcq/issues"
"Source" = "https://github.com/B612-Asteroid-Institute/mpcq"


[project.optional-dependencies]
dev = [
"black",
"ipython",
"isort",
"mypy",
"pdm",
"pytest-benchmark",
"pytest-cov",
"pytest-doctestplus",
"pytest-mock",
"pytest",
"ruff",
]

[tool.black]
line-length = 88

[tool.isort]
profile = "black"

[tool.ruff]
line-length = 110
target-version = "py311"
lint.ignore = []
exclude = ["build"]

[tool.mypy]
ignore_missing_imports = true
Loading

0 comments on commit af813a9

Please sign in to comment.