Skip to content

Commit

Permalink
Migrate from setup.py to pyproject.toml and update sphinx version
Browse files Browse the repository at this point in the history
  • Loading branch information
bastiencyr committed Mar 14, 2024
1 parent e7efa6a commit 7947e7b
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 135 deletions.
4 changes: 4 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# compatibility black and flake8
[flake8]
max-line-length = 88
extend-ignore = E203, E501
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ __pycache__/
cov.xml
*.lock
.run
venv

# Discard CI/OUTPUTS
CI/OUTPUT/*
Expand Down
52 changes: 13 additions & 39 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,16 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import os
import eoreader

import tomllib

eoreader_metadata = {}
with open("../pyproject.toml", "rb") as f:
eoreader_metadata = tomllib.load(f)
# -- General configuration ------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
needs_sphinx = "4"
needs_sphinx = "7"

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
Expand Down Expand Up @@ -100,16 +104,16 @@
master_doc = "index"

# General information about the project.
project = eoreader.__title__
copyright = eoreader.__copyright__[10:]
author = eoreader.__author__
project = eoreader_metadata["project"]["name"]
copyright = "SERTIT-ICube - France, https://sertit.unistra.fr/"
author = eoreader_metadata["project"]["authors"][0]["name"]

# 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.
#
# The short X.Y version.
version = eoreader.__version__
version = eoreader_metadata["project"]["version"]
# The full version, including alpha/beta/rc tags.
release = version

Expand Down Expand Up @@ -147,7 +151,7 @@
# further. For a list of options available for each theme, see the
# documentation.
html_theme_options = {
"repository_url": eoreader.__url__,
"repository_url": eoreader_metadata["project"]["urls"]["Source_Code"],
"use_repository_button": True,
"use_issues_button": True,
"use_edit_page_button": False,
Expand Down Expand Up @@ -179,36 +183,6 @@
# Output file base name for HTML help builder.
htmlhelp_basename = "eoreaderdoc"

# -- Options for LaTeX output ---------------------------------------------

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',
# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(
master_doc,
"eoreader.tex",
"EOReader Documentation",
"ICube-SERTIT",
"manual",
)
]

# -- Options for manual page output ---------------------------------------

# One entry per manual page. List of tuples
Expand All @@ -234,8 +208,8 @@

# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {
"https://docs.python.org/3/": None,
"https://docs.python-requests.org/en/master/": None,
"python": ("https://docs.python.org/3/", None),
"python-request": ("https://docs.python-requests.org/en/master/", None),
}

add_function_parentheses = False
Expand Down
13 changes: 0 additions & 13 deletions eoreader/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,3 @@ def wrapper(*args, **kwargs):
return func(*args, **kwargs)

return wrapper


from .__meta__ import (
__author__,
__author_email__,
__copyright__,
__description__,
__documentation__,
__license__,
__title__,
__url__,
__version__,
)
17 changes: 16 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@
requires = ["setuptools", "setuptools-scm"]
build-backend = "setuptools.build_meta"

[tool.setuptools.packages.find]
include = ["eoreader*"]
namespaces = false

[project]
name = "eoreader"
version = "0.20.4"
authors = [
{name = "ICube-SERTIT", email = "dev-sertit@unistra.fr"},
]
Expand Down Expand Up @@ -33,7 +38,7 @@ dependencies = [
"xarray>=0.18.0",
"rioxarray>=0.10.0",
"geopandas>=0.11.0",
"sertit[full]>=1.27.0",
"sertit[full]>=1.30.0",
"spyndex>=0.3.0",
"pyresample",
"zarr",
Expand All @@ -42,3 +47,13 @@ dependencies = [
"methodtools",
"dicttoxml",
]

[project.urls]
Bug_Tracker = "https://github.com/sertit/eoreader/issues"
Documentation = "https://eoreader.readthedocs.io"
Source_Code = "https://github.com/sertit/eoreader"

# compatibility black and isort
[tool.isort]
profile = "black"
known_first_party = ["CI", "eoreader"]
2 changes: 1 addition & 1 deletion requirements-doc.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-r requirements.txt

# Doc
sphinx<6.0.0 # workaround
sphinx
ipython # workaround
sphinx-book-theme
sphinx-copybutton
Expand Down
14 changes: 0 additions & 14 deletions setup.cfg

This file was deleted.

67 changes: 0 additions & 67 deletions setup.py

This file was deleted.

0 comments on commit 7947e7b

Please sign in to comment.