Skip to content

Commit

Permalink
Merge pull request #461 from OpenDataServices/2024-09-13-docs
Browse files Browse the repository at this point in the history
docs & python versions
  • Loading branch information
odscjames authored Sep 13, 2024
2 parents 291b87e + ba814d0 commit 62247ad
Show file tree
Hide file tree
Showing 13 changed files with 32 additions and 40 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: 3.12
architecture: x64
- uses: actions/cache@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: [ '3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
python-version: [ '3.9', '3.10', '3.11', '3.12']
jsonref-version: ["==0.3", ">1"]
steps:
- uses: actions/checkout@v2
Expand Down
13 changes: 8 additions & 5 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ version: 2

# Set the version of Python and other tools you might need
build:
os: ubuntu-22.04
os: ubuntu-24.04
tools:
python: "3.8"
python: "3.12"

# Build documentation in the docs/ directory with Sphinx
sphinx:
Expand All @@ -18,6 +18,9 @@ sphinx:

# We recommend specifying your dependencies to enable reproducible builds:
# https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
# python:
# install:
# - requirements: docs/requirements.txt
python:
install:
- requirements: requirements_dev.txt



5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

- Avoid deprecation warning from the ijson package. https://github.com/OpenDataServices/flatten-tool/pull/458

### Removed

- We no longer support Python 3.7 - security support has ended
- We no longer support Python 3.8 - security support ends 31 Oct 2024

## [0.26.0] - 2024-08-22

### Fixed
Expand Down
4 changes: 1 addition & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
# import sys
# sys.path.insert(0, os.path.abspath('.'))

import sphinx_rtd_theme

# -- General configuration ------------------------------------------------

Expand Down Expand Up @@ -130,7 +129,7 @@
# a list of builtin themes.
#
# html_theme = 'alabaster'
html_theme = "sphinx_rtd_theme"
html_theme = "odsc_default_sphinx_theme"

# 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
Expand All @@ -140,7 +139,6 @@

# Add any paths that contain custom themes here, relative to this directory.
# html_theme_path = []
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]

# The name for this set of Sphinx documents.
# "<project> v<release> documentation" by default.
Expand Down
4 changes: 2 additions & 2 deletions docs/getting-started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ will print help information specific to that sub-command.
Python Version Support
----------------------

This code supports Python 3.6 (and later).
This code supports Python 3.9 (and later).

Python 3.5 and earlier (including Python 2) are not supported, because they are
Earlier versions (including Python 2) are not supported, because they are
end of life, and some of the dependencies do not support them.
2 changes: 1 addition & 1 deletion examples/help/create-template/expected.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ usage: flatten-tool create-template [-h] -s SCHEMA [-f {csv,ods,xlsx,all}]
[--line-terminator LINE_TERMINATOR]
[--convert-wkt]

optional arguments:
options:
-h, --help show this help message and exit
-s SCHEMA, --schema SCHEMA
Path to the schema file you want to use to create the
Expand Down
2 changes: 1 addition & 1 deletion examples/help/flatten/expected.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ usage: flatten-tool flatten [-h] [-s SCHEMA] [-f {csv,ods,xlsx,all}] [--xml]
positional arguments:
input_name Name of the input JSON file.

optional arguments:
options:
-h, --help show this help message and exit
-s SCHEMA, --schema SCHEMA
Path to a relevant schema.
Expand Down
6 changes: 3 additions & 3 deletions examples/help/unflatten/expected.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ usage: flatten-tool unflatten [-h] -f {csv,ods,xlsx} [--xml]
[--metatab-schema METATAB_SCHEMA]
[--metatab-only]
[--metatab-vertical-orientation]
[--xml-schema [XML_SCHEMA [XML_SCHEMA ...]]]
[--xml-schema [XML_SCHEMA ...]]
[--default-configuration DEFAULT_CONFIGURATION]
[--root-is-list] [--disable-local-refs]
[--xml-comment XML_COMMENT] [--convert-wkt]
Expand All @@ -19,7 +19,7 @@ usage: flatten-tool unflatten [-h] -f {csv,ods,xlsx} [--xml]
positional arguments:
input_name Name of the input file or directory.

optional arguments:
options:
-h, --help show this help message and exit
-f {csv,ods,xlsx}, --input-format {csv,ods,xlsx}
File format of input file or directory.
Expand Down Expand Up @@ -65,7 +65,7 @@ optional arguments:
--metatab-vertical-orientation
Read metatab so that headings are in the first column
and data is read vertically. Only for XLSX not CSV
--xml-schema [XML_SCHEMA [XML_SCHEMA ...]]
--xml-schema [XML_SCHEMA ...]
Path to one or more XML schemas (used for sorting)
--default-configuration DEFAULT_CONFIGURATION
Comma separated list of default parsing commands for
Expand Down
6 changes: 3 additions & 3 deletions flattentool/tests/test_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ def _get_examples_in_docs_data():
examples_in_docs_data_geo = []
for root, dirs, files in os.walk("examples"):
for filename in files:
if root.startswith("examples/help/") and sys.version_info[:2] != (3, 8):
if root.startswith("examples/help/") and sys.version_info[:2] != (3, 12):
# Different versions of python produce differently formatted help output.
# We only test in one version, Python 3.8.
# We only test in one version, Python 3.12.
# (Same as we lint code with, so dev's can have one virtual env)
continue
if "cmd.txt" in filename:
Expand Down Expand Up @@ -154,7 +154,7 @@ def _test_example_in_doc_worker(root, filename):
def test_expected_number_of_examples_in_docs_data():
expected = 68
# See _get_examples_in_docs_data()
if sys.version_info[:2] != (3, 8):
if sys.version_info[:2] != (3, 12):
expected -= 3
# number of help tests
assert len(examples_in_docs_data) + len(examples_in_docs_data_geo) == expected
Expand Down
23 changes: 4 additions & 19 deletions flattentool/tests/test_json_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from __future__ import unicode_literals

import os
import sys
from collections import OrderedDict
from decimal import Decimal

Expand Down Expand Up @@ -990,24 +989,10 @@ def test_parse_bad_geojson(recwarn):
str(w.message) == "Invalid GeoJSON: TypeError(\"'int' object is not iterable\")"
)
w = recwarn.pop(UserWarning)
# There are different warning messages for Python versions before 3.8. This
# is because an old version of numpy is installed (the last compatible with
# these versions of Python), which has different messages.
if sys.version_info < (3, 8):
assert (
str(w.message)
== "Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray."
)
w = recwarn.pop(UserWarning)
assert (
str(w.message)
== "Invalid GeoJSON: ValueError('linestrings: Input operand 0 does not have enough dimensions (has 1, gufunc core with signature (i, d)->() requires 2)')"
)
else:
assert (
str(w.message)
== "Invalid GeoJSON: ValueError('setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (3,) + inhomogeneous part.')"
)
assert (
str(w.message)
== "Invalid GeoJSON: ValueError('setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (3,) + inhomogeneous part.')"
)
assert len(recwarn.list) == 0


Expand Down
2 changes: 1 addition & 1 deletion requirements_dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pytest-cov
coveralls
pytest-localserver
sphinx
sphinx_rtd_theme
odsc-default-sphinx-theme
isort
flake8<6
black==22.3.0
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,5 @@ def run(self):
},
package_data={"flattentool": ["locale/*/*/*.mo", "locale/*/*/*.po"]},
setup_requires=["babel"],
python_requires=">=3.9.0",
)

0 comments on commit 62247ad

Please sign in to comment.