Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 5 additions & 4 deletions .github/workflows/general.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ on:
push:
branches:
- main
- next
tags:
- v*.*.*
pull_request:
branches:
- main
- next
# schedule:
# - cron: "0 3 * * *"

Expand All @@ -21,7 +23,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
steps:
- name: Checkout repository
uses: actions/checkout@v5
Expand All @@ -30,8 +32,7 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
- name: Prepare environment
# https://github.com/pypa/hatch/issues/2193
run: pip3 install hatch 'virtualenv<21'
run: pip3 install hatch
- name: Prepare variables
run: cp .env.example .env
- name: Prepare secrets
Expand Down Expand Up @@ -116,7 +117,7 @@ jobs:
# Deploy

deploy:
if: github.event_name == 'push'
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand Down
3 changes: 2 additions & 1 deletion docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ Let's get started with Frictionless! We will learn how to install and use the fr

## Installation

> The framework requires Python3.8+. Versioning follows the [SemVer Standard](https://semver.org/).
> The framework requires Python3.10+. Versioning follows the [SemVer
Standard](https://semver.org/).

```bash tabs=CLI
pip install frictionless
Expand Down
11 changes: 0 additions & 11 deletions frictionless/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,6 @@
# TODO: stop using the Bugs section in the tests and split them among themed categories?


# Cleanups

try:
# For python 3.8 only, that does not support pytest_cov v7
from pytest_cov.embed import cleanup_on_sigterm

cleanup_on_sigterm()
except ImportError:
pass


# Fixtures


Expand Down
3 changes: 0 additions & 3 deletions frictionless/formats/csv/__spec__/test_parser.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import sys

import pytest

from frictionless import Detector, Dialect, formats, platform
Expand Down Expand Up @@ -108,7 +106,6 @@ def test_csv_parser_buffer():


@pytest.mark.vcr
@pytest.mark.skipif(sys.version_info < (3, 10), reason="pytest-vcr bug in Python3.8/9")
def test_csv_parser_remote():
with TableResource(path=BASEURL % "data/table.csv") as resource:
assert resource.header == ["id", "name"]
Expand Down
3 changes: 0 additions & 3 deletions frictionless/formats/json/parsers/__spec__/test_json.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import json
import sys

import pytest

Expand Down Expand Up @@ -67,7 +66,6 @@ def test_json_parser_from_buffer_keyed():


@pytest.mark.vcr
@pytest.mark.skipif(sys.version_info < (3, 10), reason="pytest-vcr bug in Python3.8/9")
def test_json_parser_from_remote():
with TableResource(path=BASEURL % "data/table.json") as resource:
assert resource.header == ["id", "name"]
Expand All @@ -78,7 +76,6 @@ def test_json_parser_from_remote():


@pytest.mark.vcr
@pytest.mark.skipif(sys.version_info < (3, 10), reason="pytest-vcr bug in Python3.8/9")
def test_json_parser_from_remote_keyed():
with TableResource(path=BASEURL % "data/table.keyed.json") as resource:
assert resource.dialect.to_descriptor() == {"json": {"keyed": True}}
Expand Down
2 changes: 0 additions & 2 deletions frictionless/formats/zip/__spec__/test_adapter.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import os
import sys
import zipfile

import pytest
Expand Down Expand Up @@ -40,7 +39,6 @@ def test_zip_adapter_to_zip_resource_path(tmpdir):


@pytest.mark.vcr
@pytest.mark.skipif(sys.version_info < (3, 10), reason="pytest-vcr bug in Python3.8/9")
def test_zip_adapter_to_zip_resource_remote_path(tmpdir):
path = os.path.join(tmpdir, "package.zip")
source = Package(resources=[Resource(path=BASEURL % "data/table.csv")])
Expand Down
4 changes: 0 additions & 4 deletions frictionless/package/__spec__/test_general.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import sys
import textwrap
from collections.abc import Mapping
from importlib import import_module
Expand Down Expand Up @@ -127,7 +126,6 @@ def test_package_from_path_error_bad_json_not_dict():


@pytest.mark.vcr
@pytest.mark.skipif(sys.version_info < (3, 10), reason="pytest-vcr bug in Python3.8/9")
def test_package_from_path_remote():
package = Package.from_descriptor(BASEURL % "data/package.json")
assert package.basepath == BASEURL % "data"
Expand Down Expand Up @@ -316,7 +314,6 @@ def test_package_validation_duplicate_resource_names_issue_942():


@pytest.mark.vcr
@pytest.mark.skipif(sys.version_info < (3, 10), reason="pytest-vcr bug in Python3.8/9")
def test_package_remote_scheme_regression_for_resources_issue_1388():
package = Package.from_descriptor(
"https://raw.githubusercontent.com/fdtester/test-write-package-with-dialect/main/datapackage.json"
Expand All @@ -326,7 +323,6 @@ def test_package_remote_scheme_regression_for_resources_issue_1388():


@pytest.mark.vcr
@pytest.mark.skipif(sys.version_info < (3, 10), reason="pytest-vcr bug in Python3.8/9")
def test_package_remote_windows_1505():
url = "https://raw.githubusercontent.com/transparencia-mg/datapackage-reprex/foreign-key-constraint/datapackage.json"
package = Package(url)
Expand Down
23 changes: 6 additions & 17 deletions frictionless/package/__spec__/test_profile.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import sys

import pytest
import yaml

Expand All @@ -9,7 +7,6 @@


@pytest.mark.vcr
@pytest.mark.skipif(sys.version_info < (3, 10), reason="pytest-vcr bug in Python3.8/9")
def test_package_profiles_invalid_local():
profile = "data/profiles/camtrap.json"
resource = Resource(name="table", path="data/table.csv")
Expand All @@ -23,7 +20,6 @@ def test_package_profiles_invalid_local():


@pytest.mark.vcr
@pytest.mark.skipif(sys.version_info < (3, 10), reason="pytest-vcr bug in Python3.8/9")
def test_package_profiles_invalid_local_from_descriptor():
profile = "data/profiles/camtrap.json"
resource = Resource(name="table", path="data/table.csv")
Expand Down Expand Up @@ -84,7 +80,6 @@ def test_package_profile_type(profile):


@pytest.mark.vcr
@pytest.mark.skipif(sys.version_info < (3, 10), reason="pytest-vcr bug in Python3.8/9")
def test_package_profiles_from_descriptor_standards_v1():
profile = "data/profiles/camtrap.json"
resource = Resource(name="table", path="data/table.csv")
Expand Down Expand Up @@ -114,8 +109,7 @@ def test_package_profiles_to_descriptor_standards_v1():


def test_package_preserver_profile_issue_1480():
descriptor = yaml.safe_load(
"""
descriptor = yaml.safe_load("""
profile: tabular-data-package
resources:
-
Expand All @@ -126,16 +120,14 @@ def test_package_preserver_profile_issue_1480():
mediatype: text/csv
encoding: utf-8
schema: schema.json
"""
)
""")
package = Package(descriptor)
assert package.profile == "tabular-data-package"
assert package.get_resource("some-table").profile == "tabular-data-resource"


def test_package_profile_tabular_requirements_issue_1484():
descriptor = yaml.safe_load(
"""
descriptor = yaml.safe_load("""
profile: tabular-data-package
resources:
-
Expand All @@ -145,8 +137,7 @@ def test_package_profile_tabular_requirements_issue_1484():
mediatype: text/csv
encoding: utf-8
schema: schema.json
"""
)
""")
report = Package.validate_descriptor(descriptor)
assert report.flatten(["type", "note"]) == [
[
Expand All @@ -157,8 +148,7 @@ def test_package_profile_tabular_requirements_issue_1484():


def test_package_profile_tabular_requirements_schema_issue_1484():
descriptor = yaml.safe_load(
"""
descriptor = yaml.safe_load("""
profile: tabular-data-package
resources:
-
Expand All @@ -168,8 +158,7 @@ def test_package_profile_tabular_requirements_schema_issue_1484():
format: csv
mediatype: text/csv
encoding: utf-8
"""
)
""")
report = Package.validate_descriptor(descriptor)
assert report.flatten(["type", "note"]) == [
[
Expand Down
3 changes: 0 additions & 3 deletions frictionless/package/__spec__/test_security.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import sys

import pytest

from frictionless import FrictionlessException, Package, Resource, platform, system
Expand Down Expand Up @@ -46,7 +44,6 @@ def test_package_external_profile_invalid_local_from_descriptor_unsafe():


@pytest.mark.vcr
@pytest.mark.skipif(sys.version_info < (3, 10), reason="pytest-vcr bug in Python3.8/9")
def test_package_external_profile_invalid_local_from_descriptor_unsafe_trusted():
profile = "data/../data/profiles/camtrap.json"
resource = Resource(name="table", path="data/table.csv")
Expand Down
3 changes: 0 additions & 3 deletions frictionless/resource/__spec__/test_dereference.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import sys

import pytest

from frictionless import Resource, platform
Expand Down Expand Up @@ -61,7 +59,6 @@ def test_resource_dialect_schema_from_path():


@pytest.mark.vcr
@pytest.mark.skipif(sys.version_info < (3, 10), reason="pytest-vcr bug in Python3.8/9")
@pytest.mark.skipif(platform.type == "windows", reason="Fix on Windows")
def test_resource_dialect_schema_from_path_remote():
resource = Resource(BASEURL % "data/resource-with-dereferencing.json")
Expand Down
2 changes: 0 additions & 2 deletions frictionless/resource/__spec__/test_general.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import sys
import textwrap
from importlib import import_module

Expand Down Expand Up @@ -50,7 +49,6 @@ def test_resource_source_non_tabular():


@pytest.mark.vcr
@pytest.mark.skipif(sys.version_info < (3, 10), reason="pytest-vcr bug in Python3.8/9")
def test_resource_source_non_tabular_remote():
path = BASEURL % "data/text.txt"
with Resource(path) as resource:
Expand Down
5 changes: 0 additions & 5 deletions frictionless/resource/__spec__/test_read.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
import sys

import pytest

from frictionless import Resource, resources

# General


@pytest.mark.skipif(sys.version_info < (3, 7), reason="Requires Python3.7+")
def test_resource_read_bytes():
resource = Resource(path="data/text.txt")
bytes = resource.read_bytes()
Expand Down
3 changes: 0 additions & 3 deletions frictionless/resource/__spec__/test_scheme.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import sys

import pytest

from frictionless import FrictionlessException, Resource
Expand All @@ -16,7 +14,6 @@ def test_resource_scheme_file():


@pytest.mark.vcr
@pytest.mark.skipif(sys.version_info < (3, 10), reason="pytest-vcr bug in Python3.8/9")
def test_resource_scheme_https():
with Resource(BASEURL % "data/table.csv") as resource:
assert resource.scheme == "https"
Expand Down
9 changes: 0 additions & 9 deletions frictionless/resource/__spec__/test_security.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import os
import sys

import pytest

Expand All @@ -8,7 +7,6 @@
# General


@pytest.mark.skipif(sys.version_info < (3, 10), reason="pytest-vcr bug in Python3.8/9")
def test_resource_source_path_error_bad_path_not_safe_absolute():
with pytest.raises(FrictionlessException) as excinfo:
Resource({"name": "name", "path": os.path.abspath("data/table.csv")})
Expand All @@ -21,7 +19,6 @@ def test_resource_source_path_error_bad_path_not_safe_absolute():
assert reasons[0].note.count('table.csv" is not safe')


@pytest.mark.skipif(sys.version_info < (3, 10), reason="pytest-vcr bug in Python3.8/9")
def test_resource_source_path_error_bad_path_not_safe_traversing():
with pytest.raises(FrictionlessException) as excinfo:
Resource(
Expand All @@ -43,7 +40,6 @@ def test_resource_source_path_error_bad_path_not_safe_traversing():
assert reasons[0].note.count('table.csv" is not safe')


@pytest.mark.skipif(sys.version_info < (3, 10), reason="pytest-vcr bug in Python3.8/9")
def test_resource_dialect_from_path_error_path_not_safe():
dialect = os.path.abspath("data/dialect.json")
with pytest.raises(FrictionlessException) as excinfo:
Expand All @@ -57,7 +53,6 @@ def test_resource_dialect_from_path_error_path_not_safe():
assert reasons[0].note.count('dialect.json" is not safe')


@pytest.mark.skipif(sys.version_info < (3, 10), reason="pytest-vcr bug in Python3.8/9")
def test_resource_schema_from_path_error_path_not_safe():
schema = os.path.abspath("data/schema.json")
with pytest.raises(FrictionlessException) as excinfo:
Expand All @@ -71,7 +66,6 @@ def test_resource_schema_from_path_error_path_not_safe():
assert reasons[0].note.count('schema.json" is not safe')


@pytest.mark.skipif(sys.version_info < (3, 10), reason="pytest-vcr bug in Python3.8/9")
def test_resource_extrapaths_error_bad_path_not_safe_absolute():
extrapath = os.path.abspath("data/chunk2.csv")
with pytest.raises(FrictionlessException) as excinfo:
Expand All @@ -85,7 +79,6 @@ def test_resource_extrapaths_error_bad_path_not_safe_absolute():
assert reasons[0].note.count('chunk2.csv" is not safe')


@pytest.mark.skipif(sys.version_info < (3, 10), reason="pytest-vcr bug in Python3.8/9")
@pytest.mark.skipif(platform.type == "windows", reason="Fix on Windows")
def test_resource_extrapaths_error_bad_path_not_safe_traversing():
extrapath = "data/../chunk2.csv"
Expand All @@ -100,7 +93,6 @@ def test_resource_extrapaths_error_bad_path_not_safe_traversing():
assert reasons[0].note.count('chunk2.csv" is not safe')


@pytest.mark.skipif(sys.version_info < (3, 10), reason="pytest-vcr bug in Python3.8/9")
def test_resource_profiles_error_bad_path_not_safe_absolute():
profile = os.path.abspath("data/profiles/camtrap.json")
with pytest.raises(FrictionlessException) as excinfo:
Expand All @@ -114,7 +106,6 @@ def test_resource_profiles_error_bad_path_not_safe_absolute():
assert reasons[0].note.count('camtrap.json" is not safe')


@pytest.mark.skipif(sys.version_info < (3, 10), reason="pytest-vcr bug in Python3.8/9")
@pytest.mark.skipif(platform.type == "windows", reason="Fix on Windows")
def test_resource_profiles_error_bad_path_not_safe_traversing():
profile = "data/profiles/../profiles/camtrap.json"
Expand Down
3 changes: 0 additions & 3 deletions frictionless/resources/__spec__/table/test_compression.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import sys

import pytest

from frictionless import FrictionlessException
Expand Down Expand Up @@ -166,7 +164,6 @@ def test_resource_compression_error_invalid_zip():
assert error.note == "File is not a zip file"


@pytest.mark.skipif(sys.version_info < (3, 8), reason="Requires Python3.8+")
def test_resource_compression_error_invalid_gz():
source = b"id,filename\n\1,dump"
resource = TableResource(data=source, format="csv", compression="gz")
Expand Down
Loading
Loading