Skip to content

Commit

Permalink
migrating to pyproject package management
Browse files Browse the repository at this point in the history
  • Loading branch information
rallen10 committed May 15, 2024
1 parent 08f613d commit ab9dec7
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 36 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- `pyproject.toml` for package and dependency management

### Fixed

### Changed

- Updated `setup.py` to delegate most package management to `pyproject.toml`; maintains the get_version functionality
- Updated copyright year in headers

### Removed

- `setup.py` and `version.py` since single-source version moved to `pyproject.toml` and `kspdg/__init__.py`. See https://packaging.python.org/en/latest/guides/single-sourcing-package-version/
- `requirements.txt` since there are no "pinned" or "concrete" dependencies as kspdg is not (yet?) intended to be released as a stand-alone app. For further information about the intended role of requirements.txt, see and [setup vs requirements](https://caremad.io/posts/2013/07/setup-vs-requirement/) and [use of requirements w/ pyproject](https://stackoverflow.com/questions/74508024/is-requirements-txt-still-needed-when-using-pyproject-toml)
- KSPDG Challenge announcement from README

## [v0.5.1] - 2024.01.09
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ _Future Work_
### Verify Installation
__TODO:__ Update install instructions to reflect testing w/ new `pyproject.toml` and `optional-dependencies`
__NOTE:__ Because the KSPDG environments are inexorably linked to the KSP game engine, many of the library's unit/integration test can only be run when a particular game mission file has been loaded and running. This means that verifying installation and testing during code development is a bit more involved than just a single `pytest` call
__Serverless Tests:__ Quick test to run without KSP game engine running nor kRPC server connection
Expand Down
3 changes: 1 addition & 2 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ channels:
dependencies:
- python=3
- ipython
- pytest
- pip
- pip:
- -r requirements.txt
- -e .
34 changes: 34 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# New way to specify project dependencies
# Ref:
# https://peps.python.org/pep-0518/
# Example: https://github.com/Farama-Foundation/Gymnasium/blob/main/pyproject.toml
# Example: https://github.com/pypa/sampleproject/blob/main/pyproject.toml
# Guide (user-friendly): https://packaging.python.org/en/latest/guides/writing-pyproject-toml/
# Specification (technical, formal): https://packaging.python.org/en/latest/specifications/pyproject-toml/

[build-system]
requires = ["setuptools >= 61.0.0"] # to 61 or greater support single-source versioning
build-backend = "setuptools.build_meta"

[project]
name = "kspdg"
description = "Non-cooperative satellite operations challenge problems implemented in the Kerbal Space Program game engine"
readme = "README.md"
requires-python = ">=3"

dependencies = [
"krpc",
"numpy",
"gymnasium",
"astropy"
]

# single source versioning (see tool.setuptools.dynamic table
# https://packaging.python.org/en/latest/guides/single-sourcing-package-version/
dynamic = ["version"]

[tool.setuptools.dynamic]
version = {attr = "kspdg.__version__"}

[project.optional-dependencies]
testing = ["pytest"]
1 change: 0 additions & 1 deletion requirements.txt

This file was deleted.

25 changes: 0 additions & 25 deletions setup.py

This file was deleted.

5 changes: 5 additions & 0 deletions src/kspdg/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
# Subject to FAR 52.227-11 – Patent Rights – Ownership by the Contractor (May 2014).
# SPDX-License-Identifier: MIT

# Single-sourcing package version
# https://packaging.python.org/guides/single-sourcing-package-version/

__version__ = "0.6.0"

# these imports make the individual environments accessible at the top-level
# of the library and assign an environment version number
# If the underlying environment changes, then the version number should be
Expand Down
8 changes: 0 additions & 8 deletions src/kspdg/version.py

This file was deleted.

0 comments on commit ab9dec7

Please sign in to comment.