Skip to content

Commit

Permalink
Merge pull request #32 from mwtoews/setup-cfg
Browse files Browse the repository at this point in the history
maint: move static metadata to setup.cfg; update requirements
  • Loading branch information
mdpiper committed Dec 7, 2023
2 parents 1bece69 + ff0e3d1 commit 23b9bfe
Show file tree
Hide file tree
Showing 16 changed files with 112 additions and 86 deletions.
1 change: 0 additions & 1 deletion .gitattributes

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/black.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ jobs:

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: psf/black@stable
with:
args: ". --check"
5 changes: 2 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,19 @@ jobs:
shell: bash -l {0}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
python-version: "3.11"
mamba-version: "*"
channels: conda-forge,defaults
channel-priority: true

- name: Install requirements
run: |
mamba install --file=requirements.txt --file=requirements-docs.txt
mamba install gimli.units
mamba info
mamba list
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/flake8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@ jobs:

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: "3.11"

- name: Lint
run: |
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.7, 3.8, 3.9]
python-version: ["3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: conda-incubator/setup-miniconda@v2
with:
Expand All @@ -41,7 +41,6 @@ jobs:
- name: Install requirements
run: |
mamba install --file=requirements.txt --file=requirements-testing.txt
mamba install gimli.units
mamba list
- name: Build and install package
Expand Down
17 changes: 6 additions & 11 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
version: 2

build:
os: ubuntu-22.04
tools:
python: "3.11"

sphinx:
builder: html
configuration: docs/conf.py
fail_on_warning: false

formats:
- htmlzip

conda:
environment: environment.yml

python:
version: 3.8
install:
- requirements: requirements-docs.txt
- method: pip
path: .
system_packages: false

build:
image: latest
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
include LICENSE
include *.rst
include requirements*.txt
include Makefile
Expand Down
7 changes: 3 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ lint: ## check style with flake8

pretty:
find bmi_tester -name '*.py' | xargs isort
black setup.py tests bmi_tester
black tests bmi_tester

test: ## run tests quickly with the default Python
pytest
Expand Down Expand Up @@ -83,9 +83,8 @@ release: dist ## package and upload a release
twine upload dist/*

dist: clean ## builds source and wheel package
python setup.py sdist
python setup.py bdist_wheel
python -m build
ls -l dist

install: clean ## install the package to the active Python's site-packages
python setup.py develop
pip install -e .
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ From Source
+++++++++++

After downloading the *bmi-tester* source code, run the following from
the project's top-level folder (the one that contains *setup.py*) to
the project's top-level folder (the one that contains *pyproject.toml*) to
install into the current environment,

.. code:: bash
Expand Down
1 change: 0 additions & 1 deletion bmi_tester/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ def var_name(request):


def pytest_generate_tests(metafunc):

if "gid" in metafunc.fixturenames:
metafunc.parametrize("gid", params["gid"])
# elif "var_name" in metafunc.fixturenames:
Expand Down
12 changes: 6 additions & 6 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@
master_doc = "index"

# General information about the project.
project = u"bmi_tester"
copyright = u"2017, Eric Hutton"
author = u"Eric Hutton"
project = "bmi_tester"
copyright = "2017, Eric Hutton"
author = "Eric Hutton"

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand Down Expand Up @@ -228,7 +228,7 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, "bmi_tester.tex", u"bmi\\_tester Documentation", u"Author", "manual"),
(master_doc, "bmi_tester.tex", "bmi\\_tester Documentation", "Author", "manual"),
]

# The name of an image file (relative to this directory) to place at the top of
Expand Down Expand Up @@ -256,7 +256,7 @@

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [(master_doc, "bmi_tester", u"bmi_tester Documentation", [author], 1)]
man_pages = [(master_doc, "bmi_tester", "bmi_tester Documentation", [author], 1)]

# If true, show URL addresses after external links.
# man_show_urls = False
Expand All @@ -271,7 +271,7 @@
(
master_doc,
"bmi_tester",
u"bmi_tester Documentation",
"bmi_tester Documentation",
author,
"bmi_tester",
"One line description of project.",
Expand Down
1 change: 0 additions & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ name: bmi-tester
channels:
- conda-forge
dependencies:
- gimli.units
- pip
- pip:
- -r file:requirements.txt
Expand Down
85 changes: 83 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,90 @@
[build-system]
requires = ["cython", "numpy", "setuptools", "wheel"]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "bmi-tester"
description = "Test Python BMI bindings"
version = "0.5.6.dev0"
authors = [
{email = "eric.hutton@colorado.edu"},
{name = "Eric Hutton"},
]
maintainers = [
{email = "eric.hutton@colorado.edu"},
{name = "Eric Hutton"},
{email = "mark.piper@colorado.edu"},
{name = "Mark Piper"}
]
keywords = [
"bmi",
"csdms",
"model",
"python",
]
license = {file = "LICENSE"}
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3",
"Topic :: Scientific/Engineering :: Physics",
]
requires-python = ">=3.9"
dependencies = [
"click",
"gimli.units",
"model_metadata",
"numpy",
"pytest",
"pytest-dependency",
"standard_names",
]
dynamic = ["readme"]

[project.optional-dependencies]
dev = [
"black",
"flake8",
]
testing = [
"coveralls",
"pytest>=3.6",
"pytest-cov",
]
docs = [
"sphinx>=1.5.1",
]
build = [
"build",
"twine",
"zest.releaser"
]

[project.urls]
homepage = "https://csdms.colorado.edu"
documentation = "https://csdms.colorado.edu"
repository = "https://github.com/csdms/bmi-tester"
changelog = "https://github.com/csdms/bmi-tester/blob/master/CHANGES.rst"

[project.scripts]
bmi-test = "bmi_tester.bmipytest:main"

[project.entry-points."bmi.plugins"]
bmi_test = "bmi_tester.bmipytest:configure_parser_test"

[tool.setuptools.dynamic]
readme = {file = ["README.rst", "CREDITS.rst", "CHANGES.rst"], content-type = "text/x-rst"}

[tool.pytest.ini_options]
minversion = "6.0.0rc1"
testpaths = ["tests"]
norecursedirs = [".*", "*.egg*", "build", "dist"]
addopts = """
--ignore setup.py
--ignore bmi_tester/bootstrap
--ignore bmi_tester/tests
--tb native
Expand All @@ -27,3 +105,6 @@ include_trailing_comma = true
force_grid_wrap = 0
combine_as_imports = true
line_length = 88

[tool.zest-releaser]
tag-format = "v{version}"
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
click
gimli.units
model_metadata
numpy
pytest
Expand Down
6 changes: 3 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[zest.releaser]
tag-format = v{version}

[flake8]
exclude = docs
ignore =
E203
E501
W503
max-line-length = 88

[coverage:run]
relative_files = True
43 changes: 0 additions & 43 deletions setup.py

This file was deleted.

0 comments on commit 23b9bfe

Please sign in to comment.