Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAINT: pyproject.toml, docs #129

Merged
merged 45 commits into from
May 30, 2023
Merged
Show file tree
Hide file tree
Changes from 36 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
71a62be
MAINT: migrate to pyproject.toml
jklenzing Oct 25, 2022
03eefb0
MAINT: one version
jklenzing Oct 25, 2022
16c924a
DOC: update changelog
jklenzing Oct 25, 2022
e71fce4
TST: try new docs install
jklenzing Oct 25, 2022
172c325
STY: docstring
jklenzing Oct 25, 2022
f6a774a
DOC/BUG: update docs
jklenzing Oct 25, 2022
4f6bad4
TST: update main job
jklenzing Oct 25, 2022
2e42767
TST: remove pysatcdf
jklenzing Oct 25, 2022
ab26d38
MAINT: drop requirements files
jklenzing Oct 25, 2022
4ac4167
BUG: install flake8
jklenzing Oct 25, 2022
64496cf
STY: whitespace
jklenzing Oct 25, 2022
1301eee
STY: group optional dependencies
jklenzing Oct 25, 2022
2788454
DOC: show optional requirements
jklenzing Oct 25, 2022
2a8b50c
TST: improve nep29
jklenzing Oct 25, 2022
4b2a317
TST: optional pysatcdf
jklenzing Oct 25, 2022
cd7a86f
Update main.yml
jklenzing Oct 26, 2022
a7e8f73
Merge branch 'develop' into sty/pyproject
jklenzing Oct 26, 2022
d48ff06
STY: cleanup
jklenzing Oct 26, 2022
e22664b
BUG: optional pysatCDF
jklenzing Oct 26, 2022
9faf534
Merge branch 'develop' into sty/pyproject
jklenzing Apr 6, 2023
e38bcd5
STY: clean up reqs
jklenzing Apr 6, 2023
fc14e62
STY: restore backup requirement lists
jklenzing Apr 6, 2023
2a321e8
Merge branch 'develop' into sty/pyproject
jklenzing Apr 6, 2023
1e7e65a
MAINT: delete version
jklenzing Apr 6, 2023
617e18c
Merge branch 'develop' into sty/pyproject
jklenzing Apr 12, 2023
b0d6f08
Merge branch 'develop' into sty/pyproject
jklenzing May 5, 2023
92846cb
Apply suggestions from code review
jklenzing May 5, 2023
08000ab
DOC: update docs
jklenzing May 5, 2023
23da8f8
TST: update tested versions
jklenzing May 5, 2023
a856767
DOC: update meta
jklenzing May 5, 2023
de9efbb
Merge branch 'tst/rc_fix' into sty/pyproject
jklenzing May 5, 2023
04e0909
Merge branch 'tst/rc_fix' into sty/pyproject
jklenzing May 5, 2023
1d48f49
BUG: operational tests
jklenzing May 16, 2023
859635b
Update main.yml
jklenzing May 16, 2023
0149729
BUG: quotes
jklenzing May 16, 2023
e0ffbad
Update main.yml
jklenzing May 16, 2023
f554299
Update __init__.py
jklenzing May 17, 2023
edd0c41
Update __init__.py
jklenzing May 18, 2023
ba59f29
Update pyproject.toml
jklenzing May 18, 2023
771939d
Update pyproject.toml
jklenzing May 18, 2023
879f3a5
Update setup.cfg
jklenzing May 18, 2023
5e0cd34
Update setup.cfg
jklenzing May 18, 2023
df393f4
Merge branch 'tst/rc_fix' into sty/pyproject
jklenzing May 18, 2023
f86fd9d
STY: update meta
jklenzing May 30, 2023
2b41e01
BUG: fix metadata
jklenzing May 30, 2023
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
3 changes: 1 addition & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r test_requirements.txt
pip install -r requirements.txt
pip install .[doc]

- name: Set up pysat
run: |
Expand Down
31 changes: 23 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,18 @@ jobs:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
python-version: ["3.9", "3.10"]
python-version: ["3.10", "3.11"]
numpy_ver: ["latest"]
test_config: ["latest"]
include:
- python-version: "3.8"
- python-version: "3.9"
numpy_ver: "1.21"
os: "ubuntu-latest"
os: ubuntu-latest
test_config: "NEP29"
- python-version: "3.6.8"
numpy_ver: "1.19.5"
os: "ubuntu-20.04"
test_config: "Ops"

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

- name: Install Operational dependencies
if: ${{ matrix.test_config == 'Ops'}}
run: |
pip install --no-cache-dir numpy==${{ matrix.numpy_ver }}
pip install -r requirements.txt
pip install -r test_requirements.txt
pip install .

- name: Install NEP29 dependencies
if: ${{ matrix.numpy_ver != 'latest'}}
if: ${{ matrix.test_config == 'NEP29'}}
run: |
pip install --no-cache-dir numpy==${{ matrix.numpy_ver }}
pip install --upgrade-strategy only-if-needed .[test]

- name: Install standard dependencies
if: ${{ matrix.test_config == 'latest'}}
run: |
pip install -r requirements.txt
pip install -r test_requirements.txt
pip install .[test]

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

- name: Test with pytest
run: pytest -vs --cov=pysatNASA/
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ This project adheres to [Semantic Versioning](https://semver.org/).
* Update meta label type for instruments
* Updated Github Actions workflows for improved compliance with pip>=23.0
* Added .readthedocs.yml to configure settings there.
* Use pyproject.toml to manage installation and metadata

## [0.0.4] - 2022-11-07
* Update instrument tests with new test class
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div align="left">
<img height="0" width="0px">
<img width="20%" src="https://raw.githubusercontent.com/pysat/pysatNASA/main/docs/figures/logo.png" alt="pysatNASA" title="pysatNASA" </img>
<img width="20%" src="https://raw.githubusercontent.com/pysat/pysatNASA/main/docs/figures/pysatnasa_logo.png" alt="pysatNASA" title="pysatNASA" </img>
</div>

# pysatNASA: pysat support for NASA Space Science instruments
Expand All @@ -20,14 +20,14 @@ some examples on how to use the routines

pysatNASA uses common Python modules, as well as modules developed by
and for the Space Physics community. This module officially supports
Python 3.8+.
Python 3.6+.

| Common modules | Community modules | Optional Modules |
| ---------------- | ----------------- |------------------|
| beautifulsoup4 | cdflib | pysatCDF |
| lxml | pysat>=3.0.4 | |
| netCDF4 | | |
| numpy<1.24 | | |
| numpy | | |
| pandas | | |
| requests | | |
| xarray | | |
Expand All @@ -43,12 +43,12 @@ pip install pysatNASA
git clone https://github.com/pysat/pysatNASA.git
```

Change directories into the repository folder and run the setup.py file. For
Change directories into the repository folder and build the project. For
a local install use the "--user" flag after "install".

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

Note: pre-1.0.0 version
Expand Down
7 changes: 3 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import json
import os
import pkg_resources
import sys
sys.path.insert(0, os.path.abspath('..'))

Expand Down Expand Up @@ -63,9 +64,7 @@
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
doc_dir = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(doc_dir, "..", project, "version.txt"), "r") as fin:
version = fin.read().strip()
version = pkg_resources.get_distribution('pysatNASA').version
release = '{:s}-alpha'.format(version) # Include alpha/beta/rc tags.

# The language for content autogenerated by Sphinx. Refer to documentation
Expand Down Expand Up @@ -97,7 +96,7 @@
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
html_logo = os.path.join(os.path.abspath('.'), 'figures', 'logo.png')
html_logo = os.path.join(os.path.abspath('.'), 'figures', 'pysatnasa_logo.png')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, there's a better way to manage files and stuff in packages now. See the stuff here: aburrell/apexpy#123

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure how to implement this in the docs. I don't have a package to refer to

html_theme_options = {'logo_only': True}

# Add any paths that contain custom static files (such as style sheets) here,
Expand Down
File renamed without changes
22 changes: 15 additions & 7 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,24 +40,32 @@ Installation Options


2. Install pysatNASA:
Change directories into the repository folder and run the setup.py file.
Change directories into the repository folder and build the project.
There are a few ways you can do this:

A. Install on the system (root privileges required)::


sudo python setup.py install
sudo pip install .
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you might need to run python -m build first.


B. Install at the user level::


python setup.py install --user
C. Install with the intent to develop locally::
pip install --user .

C. Install with the intent to change the code::


pip install --user -e .

.. extras-require:: pysatcdf
:pyproject:

python setup.py develop --user
.. extras-require:: test
:pyproject:

.. extras-require:: all
:setup.cfg:
.. extras-require:: doc
:pyproject:

.. _post-install:

Expand Down
2 changes: 1 addition & 1 deletion docs/overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This is a library of ``pysat`` instrument modules and methods designed to suppor
NASA instruments and missions archived at the Community Data Analysis Web
portal.

.. image:: figures/logo.png
.. image:: figures/pysatnasa_logo.png
:width: 400px
:align: center
:alt: pysatNASA Logo, a blue planet with red orbiting python and the module name superimposed
88 changes: 88 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
[build-system]
requires = ["setuptools", "pip >= 10"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need a minimum version for setuptools? Or a maximum version?

jklenzing marked this conversation as resolved.
Show resolved Hide resolved
build-backend = "setuptools.build_meta"
jklenzing marked this conversation as resolved.
Show resolved Hide resolved

[project]
name = "pysatNASA"
version = "0.0.5"
description = "pysat support for NASA Instruments"
readme = "README.md"
requires-python = ">=3.6"
license = {file = "LICENSE"}
authors = [
{name = "Jeff Klenzing, et al.", email = "[email protected]"},
]
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.6",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Operating System :: POSIX :: Linux",
"Operating System :: MacOS :: MacOS X",
"Operating System :: Microsoft :: Windows"
]
keywords = [
"pysat",
"ionosphere",
"magnetosphere",
"solar wind",
"thermosphere"
]
dependencies = [
"beautifulsoup4",
"cdasws",
"cdflib >= 0.4.4",
"lxml",
"netCDF4",
"numpy",
"pandas",
"pysat >= 3.0.4",
"requests",
"xarray"
]

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

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

[tool.coverage.report]
omit = ["*/instruments/templates/"]

[tool.pytest.ini_options]
addopts = "-vs --cov=pysatNASA"
markers = [
"all_inst",
"download",
"no_download",
"load_options",
"first",
"second"
]
9 changes: 3 additions & 6 deletions pysatNASA/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,10 @@

"""

import os
import pkg_resources

from pysatNASA import constellations # noqa F401
from pysatNASA import instruments # noqa F401

# set version
here = os.path.abspath(os.path.dirname(__file__))
version_filename = os.path.join(here, 'version.txt')
with open(version_filename, 'r') as version_file:
__version__ = version_file.read().strip()
del here, version_filename, version_file
__version__ = pkg_resources.get_distribution('pysatNASA').version
1 change: 0 additions & 1 deletion pysatNASA/version.txt

This file was deleted.

8 changes: 4 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
netCDF4
requests
beautifulsoup4
lxml
cdasws
cdflib>=0.4.4
lxml
netCDF4
numpy
pandas
pysat>=3.0.4
cdasws
requests
xarray
63 changes: 0 additions & 63 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,69 +1,6 @@
[metadata]
name = pysatNASA
version = file: pysatNASA/version.txt
url = https://github.com/pysat/pysatNASA
author = Jeff Klenzing
author_email = [email protected]
description = 'pysat support for NASA Instruments'
keywords =
pysat
ionosphere
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.5
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Operating System :: MacOS :: MacOS X
Operating System :: POSIX :: Linux
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 =
cdasws
netCDF4
requests
beautifulsoup4
lxml
cdflib
numpy
pandas
xarray
pysat

[options.extras_require]
all =
pysatCDF

[coverage:report]
omit =
*/instruments/templates/

[flake8]
max-line-length = 80
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
Loading