Skip to content

Commit

Permalink
Merge pull request #99 from pysat/sty/pyproject
Browse files Browse the repository at this point in the history
MAINT: pyproject.toml, nep29
  • Loading branch information
jklenzing committed Jun 2, 2023
2 parents 19006df + 7d49ef5 commit 6f124a9
Show file tree
Hide file tree
Showing 13 changed files with 135 additions and 112 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,8 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r test_requirements.txt
- name: Install with dependencies
run: pip install .[doc]

- name: Check documentation build
run: sphinx-build -E -b html docs dist/docs
Expand Down
50 changes: 28 additions & 22 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10"]
os: ["macos-latest", "ubuntu-latest", "windows-latest"]
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
python-version: ["3.10", "3.11"]
numpy_ver: ["latest"]
include:
- python-version: "3.8"
numpy_ver: "nep29"
os: ubuntu-latest
- python-version: "3.9"
numpy_ver: "1.21"
os: "ubuntu-latest"

name: Python ${{ matrix.python-version }} on ${{ matrix.os }} with numpy ${{ matrix.numpy_ver }}
runs-on: ${{ matrix.os }}
Expand All @@ -32,26 +32,32 @@ jobs:
if: ${{ matrix.os == 'macos-latest' }}
run: brew reinstall gcc

- name: Install requirements for testing setup
run: |
python -m pip install --upgrade pip
pip install -r test_requirements.txt
- name: Install NEP29 dependencies
if: ${{ matrix.numpy_ver != 'latest'}}
run: |
pip install -r requirements.txt -c nep29_constraints.txt
pip install aacgmv2 -c nep29_constraints.txt
# Ignoring optional apexpy build for NEP29 case
pip install OMMBV -c nep29_constraints.txt
pip install numpy==${{ matrix.numpy_ver }}
pip install --upgrade-strategy only-if-needed .[test]
- name: Install dependencies with latest numpy
- name: Install standard dependencies
if: ${{ matrix.numpy_ver == 'latest'}}
run: |
pip install -r requirements.txt
pip install aacgmv2 --no-binary==aacgmv2
pip install apexpy --no-binary==apexpy
pip install OMMBV --no-binary==OMMBV
run: pip install .[test]

- name: Install aacgmv2
# Optional package, continue with tests if install fails
continue-on-error: true
run: pip install aacgmv2 --no-binary==aacgmv2

- name: Install apexpy
# Skip apexpy for nep29 tests
if: ${{ matrix.numpy_ver == 'latest'}}
# Optional package, continue with tests if install fails
continue-on-error: true
run: pip install apexpy --no-binary==apexpy

- name: Install OMMBV
# Optional package, continue with tests if install fails
continue-on-error: true
run: pip install OMMBV --no-binary==OMMBV

- name: Set up pysat
run: |
Expand All @@ -65,9 +71,9 @@ jobs:
run: flake8 . --count --exit-zero --max-complexity=10 --statistics

- name: Test with pytest
run: pytest --cov=pysatMissions/
run: pytest

- name: Publish results to coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: coveralls --rcfile=setup.cfg --service=github
run: coveralls --rcfile=pyproject.toml --service=github
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](https://semver.org/).

## [0.X.X] - 2023-XX-XX
## [0.3.4] - 2023-XX-XX
* Maintenance
* Update pytest syntax
* Update Github Actions versions
Expand All @@ -13,6 +13,7 @@ This project adheres to [Semantic Versioning](https://semver.org/).
* Add tests for NEP 29 testing
* Add tests for Mac OS
* Deprecate `calculate_ecef_velocity` method
* Use pyproject.toml to handle metadata / installation
* Testing
* Include checks on sc coordinate transformation calculations

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ a local install use the "--user" flag after "install".

```
cd pysatMissions/
python setup.py install
pip install .
```

Note: pre-1.0.0 version
Expand Down
10 changes: 5 additions & 5 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,23 @@
#
import json
import os
from pyproject_parser import PyProject
import sys
sys.path.insert(0, os.path.abspath('..'))

# -- Project information -----------------------------------------------------

info = PyProject.load("../pyproject.toml")

project = 'pysatMissions'
title = '{:s} Documentation'.format(project)
zenodo = json.loads(open('../.zenodo.json').read())
author = ', '.join([creator['name'] for creator in zenodo['creators']])
copyright = ', '.join(['2022', author])
description = 'Tools for generating simulated instruments in pysat.'
description = info.project['description']

# The short X.Y version
module_dir = os.path.split(os.path.abspath(os.path.dirname(__file__)))[0]
version_file = os.path.join(module_dir, project, 'version.txt')
with open(version_file, 'r') as fin:
version = fin.read().strip()
version = info.project['version'].base_version

# The full version, including alpha/beta/rc tags.
release = '{:s}-alpha'.format(version)
Expand Down
10 changes: 5 additions & 5 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ Python 3.8+ and pysat 3.0.4+.
================ =================== ==================


Installation Options
--------------------
Installation Options
--------------------

1. Clone the git repository
::
Expand All @@ -43,17 +43,17 @@ Python 3.8+ and pysat 3.0.4+.
A. Install on the system (root privileges required)::


sudo python setup.py install
sudo pip install .

B. Install at the user level::


python setup.py install --user
pip install --user .

C. Install with the intent to develop locally::


python setup.py develop --user
pip install -e --user .


.. _post-install:
Expand Down
1 change: 1 addition & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ numpydoc
geospacepy
numpy
pandas
pyproject_parser
pysat>=3.0
pyEphem
sgp4>=2.7
1 change: 0 additions & 1 deletion nep29_constraints.txt

This file was deleted.

87 changes: 87 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
[build-system]
requires = ["setuptools", "pip >= 10"]
build-backend = "setuptools.build_meta"

[project]
name = "pysatMissions"
version = "0.3.4"
description = "Mission Planning toolkit for pysat"
readme = "README.md"
requires-python = ">=3.8"
license = {file = "LICENSE"}
authors = [
{name = "Jeff Klenzing", email = "pysat.developers@gmail.com"}
]
classifiers = [
"Development Status :: 3 - Alpha",
"Topic :: Scientific/Engineering :: Astronomy",
"Topic :: Scientific/Engineering :: Physics",
"Topic :: Scientific/Engineering :: Atmospheric Science",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: BSD License",
"Natural Language :: English",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Operating System :: POSIX :: Linux",
"Operating System :: MacOS :: MacOS X",
"Operating System :: Microsoft :: Windows"
]
keywords = [
"pysat",
"ionosphere",
"cubesat",
"satellite",
"ephemeris",
"orbit",
"mission-planning"
]
dependencies = [
"geospacepy",
"numpy",
"pandas",
"pysat >= 3.0.4",
"pyEphem",
"sgp4 >= 2.7"
]

[project.optional-dependencies]
aacgmv2 = ["aacgmv2"]
apexpy = ["apexpy"]
OMMBV = ["OMMBV"]
test = [
"coveralls < 3.3",
"flake8",
"flake8-docstrings",
"hacking >= 1.0",
"pytest",
"pytest-cov",
"pytest-ordering"
]
doc = [
"extras_require",
"ipython",
"m2r2",
"numpydoc",
"pyproject_parser",
"sphinx",
"sphinx_rtd_theme"
]

[project.urls]
Documentation = "https://pysatmissions.readthedocs.io/en/latest/"
Source = "https://github.com/pysat/pysatMissions"

[tool.coverage.report]

[tool.pytest.ini_options]
addopts = "--cov=pysatMissions"
markers = [
"all_inst",
"download",
"no_download",
"load_options",
"first",
"second"
]
7 changes: 2 additions & 5 deletions pysatMissions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,12 @@
"""

import os
import importlib

from pysatMissions import instruments
from pysatMissions import methods
from pysatMissions import utils

__all__ = ['instruments', 'methods', 'utils']

# set version
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, 'version.txt')) as version_file:
__version__ = version_file.read().strip()
__version__ = importlib.metadata.version('pysatMissions')
1 change: 0 additions & 1 deletion pysatMissions/version.txt

This file was deleted.

65 changes: 0 additions & 65 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,71 +1,6 @@
[metadata]
name = pysatMissions
version = file: pysatMissions/version.txt
url = https://github.com/pysat/pysatMissions
author = Jeff Klenzing, Russell Stoneback
author_email = pysat.developers@gmail.com
description = 'Mission Planning toolkit for pysat'
keywords =
pysat
ionosphere
cubesat
satellite
ephemeris
orbit
mission-planning
classifiers =
Development Status :: 3 - Alpha
Topic :: Scientific/Engineering :: Physics
Topic :: Scientific/Engineering :: Atmospheric Science
Intended Audience :: Science/Research
License :: OSI Approved :: BSD License
Natural Language :: English
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Operating System :: MacOS :: MacOS X
Operating System :: POSIX :: Linux
Operating System :: Microsoft :: Windows
license_file = LICENSE
long_description = file: README.md
long_description_content_type = text/markdown

[options]
python_requires = >= 3.5
setup_requires =
setuptools >= 38.6
pip >= 10
include_package_data = True
zip_safe = False
packages = find:
install_requires =
geospacepy
numpy
pandas
pysat
pyEphem
sgp4

[options.extras_require]
aacgmv2 = aacgmv2
apexpy = apexpy
OMMBV = OMMBV


[coverage:report]

[flake8]
max-line-length = 90
ignore =
D200
D202
W503

[tool:pytest]
markers =
all_inst: tests all instruments
download: tests for downloadable instruments
no_download: tests for instruments without download support
load_options: tests for instruments with additional options
first: first tests to run
second: second tests to run
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

from setuptools import setup

# package metadata stored in setup.cfg
# Package metadata is stored in pyproject.toml.
# Tool configurations are stored in setup.cfg.

setup()

0 comments on commit 6f124a9

Please sign in to comment.