Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ updates:
schedule:
interval: daily
open-pull-requests-limit: 1024
cooldown:
default-days: 7
32 changes: 21 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,25 @@ env:
UV_NO_SYNC: "true"

jobs:
pre-commit:
name: "pre-commit"
lint:
name: "lint"
runs-on: ubuntu-latest

steps:
- uses: "actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10" # v6.0.3
- uses: "actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1" # v7.0.1
with:
persist-credentials: false
- uses: "j178/prek-action@bdca6f102f98e2b4c7029491a53dfd366469e33d" # v2.0.4
- uses: "actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97" # v7.0.0
with:
python-version: "3.12"
- uses: "astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9" # v9.0.0
with:
enable-cache: true
- uses: "j178/prek-action@5337cb91e0fa35a7ff31b9ca345126d8bbbcdf16" # v2.0.6
- name: "Check source distribution contents"
run: |
uv sync --only-group check-sdist
uv run check-sdist

tests:
name: "Python ${{ matrix.python-version }}"
Expand All @@ -37,41 +47,41 @@ jobs:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]

steps:
- uses: "actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10" # v6.0.3
- uses: "actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1" # v7.0.1
with:
persist-credentials: false
- uses: "actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405" # v6.2.0
- uses: "actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97" # v7.0.0
with:
python-version: "${{ matrix.python-version }}"
allow-prereleases: true
- uses: "astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39" # v8.2.0
- uses: "astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9" # v9.0.0
with:
enable-cache: true
- name: "Install dependencies"
run: |
python -VV
python -m site
uv --version
uv sync --only-group nox --only-group coverage
uv sync --only-group nox --only-group coverage --no-install-project
- name: "Run nox targets for ${{ matrix.python-version }}"
run: "uv run nox --python ${{ matrix.python-version }}"
- name: "Convert coverage"
run: |
uv run coverage combine
uv run coverage xml
- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}

required:
alls-green:
name: "all required checks passed"
runs-on: "ubuntu-latest"
if: always()

needs:
- pre-commit
- lint
- tests

steps:
Expand Down
64 changes: 64 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Upload Python Package

on:
push:
tags:
- "*"

permissions:
contents: read

jobs:
deploy:
runs-on: ubuntu-latest
environment:
name: publish
url: https://pypi.org/p/spacetrack
permissions:
contents: read
id-token: write
attestations: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
with:
enable-cache: false
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.x"
- name: Build
run: "uv build"
- name: Publish
uses: pypa/gh-action-pypi-publish@ba38be9e461d3875417946c167d0b5f3d385a247 # v1.14.1

release:
needs: deploy
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Extract release notes
run: |
awk -v version="$GITHUB_REF_NAME" '
index($0, "/releases/tag/" version ">`_ - ") { found = 1; skip_underline = 1; next }
found && skip_underline { skip_underline = 0; next }
found && /^[0-9][^ ]*_ - [0-9]{4}-[0-9]{2}-[0-9]{2}$/ { exit }
found && /\/releases\/tag\/[^>]+>`_ - [0-9]{4}-[0-9]{2}-[0-9]{2}$/ { exit }
found { print }
END { if (!found) exit 1 }
' docs/changelog.rst > release-notes.rst
grep -q '[^[:space:]]' release-notes.rst
- name: Create GitHub Release
run: |
gh release create "$GITHUB_REF_NAME" \
--verify-tag \
--title "$GITHUB_REF_NAME" \
--notes-file release-notes.rst
env:
GH_TOKEN: ${{ github.token }}
32 changes: 0 additions & 32 deletions .github/workflows/python-publish.yml

This file was deleted.

9 changes: 0 additions & 9 deletions MANIFEST.in

This file was deleted.

32 changes: 16 additions & 16 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ spacetrack

|PyPI Version| |Documentation| |CI Status| |Coverage| |Python Version| |MIT License|

spacetrack is a python module for `Space-Track <https://www.space-track.org>`__
spacetrack is a Python client for `Space-Track <https://www.space-track.org>`__.

Installation
~~~~~~~~~~~~
Expand Down Expand Up @@ -63,22 +63,22 @@ Documentation
~~~~~~~~~~~~~

For in-depth information, `visit the
documentation <http://spacetrack.readthedocs.org/en/latest/>`__!
documentation <https://spacetrack.readthedocs.io/en/latest/>`__!

Development
~~~~~~~~~~~

spacetrack uses `semantic versioning <http://semver.org>`__

.. |CI Status| image:: https://github.com/python-astrodynamics/spacetrack/workflows/CI/badge.svg?branch=master
:target: https://github.com/python-astrodynamics/spacetrack/actions?workflow=CI
.. |PyPI Version| image:: http://img.shields.io/pypi/v/spacetrack.svg?style=flat-square
:target: https://pypi.python.org/pypi/spacetrack/
.. |Python Version| image:: https://img.shields.io/badge/python-3.6%2B-brightgreen.svg?style=flat-square
:target: https://www.python.org/downloads/
.. |MIT License| image:: http://img.shields.io/badge/license-MIT-blue.svg?style=flat-square
:target: https://raw.githubusercontent.com/python-astrodynamics/spacetrack/master/LICENSE.txt
.. |Coverage| image:: https://img.shields.io/codecov/c/github/python-astrodynamics/spacetrack/master.svg?style=flat-square
:target: https://codecov.io/github/python-astrodynamics/spacetrack?branch=master
.. |Documentation| image:: https://img.shields.io/badge/docs-latest-brightgreen.svg?style=flat-square
:target: http://spacetrack.readthedocs.org/en/latest/
spacetrack uses `semantic versioning <https://semver.org>`__.

.. |CI Status| image:: https://github.com/python-astrodynamics/spacetrack/actions/workflows/ci.yml/badge.svg?branch=main
:target: https://github.com/python-astrodynamics/spacetrack/actions/workflows/ci.yml
.. |PyPI Version| image:: https://img.shields.io/pypi/v/spacetrack.svg?style=flat-square
:target: https://pypi.org/project/spacetrack/
.. |Python Version| image:: https://img.shields.io/pypi/pyversions/spacetrack.svg?style=flat-square
:target: https://pypi.org/project/spacetrack/
.. |MIT License| image:: https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square
:target: https://raw.githubusercontent.com/python-astrodynamics/spacetrack/main/LICENSE.txt
.. |Coverage| image:: https://codecov.io/gh/python-astrodynamics/spacetrack/branch/main/graph/badge.svg
:target: https://codecov.io/gh/python-astrodynamics/spacetrack
.. |Documentation| image:: https://readthedocs.org/projects/spacetrack/badge/?version=latest
:target: https://spacetrack.readthedocs.io/en/latest/
2 changes: 2 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Change Log
==========

.. towncrier release notes start

1.4.0_ - 2025-02-21
-------------------

Expand Down
1 change: 1 addition & 0 deletions newsfragments/+modernize.changed.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Modernize the packaging, test, documentation, and release tooling.
1 change: 1 addition & 0 deletions newsfragments/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
!.gitignore
42 changes: 42 additions & 0 deletions noxfile.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
from collections.abc import Iterator
from contextlib import contextmanager

import nox

nox.options.reuse_existing_virtualenvs = True
Expand Down Expand Up @@ -36,3 +39,42 @@ def tests(session: nox.Session) -> None:
)

session.run("coverage", "run", "-m", "pytest", *session.posargs)


@nox.session(name="test-min-deps", python=PYTHON_VERSIONS)
def test_min_deps(session: nox.Session) -> None:
with restore_file("uv.lock"):
session.run_install(
"uv",
"sync",
"--no-default-groups",
"--group=test",
"--resolution=lowest-direct",
)

session.run("pytest", *session.posargs)


@nox.session(name="test-latest", python=PYTHON_VERSIONS)
def test_latest(session: nox.Session) -> None:
session.run_install(
"uv",
"sync",
"--no-default-groups",
"--group=test",
"--no-install-project",
)
session.run_install("uv", "pip", "install", "--upgrade", ".")

session.run("pytest", *session.posargs)


@contextmanager
def restore_file(path: str) -> Iterator[None]:
with open(path, "rb") as f:
original = f.read()
try:
yield
finally:
with open(path, "wb") as f:
f.write(original)
Loading
Loading