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

chore(deps): update to latest compatible path version >=16.2, <=16.7.1 #314

Merged
merged 4 commits into from
Jul 12, 2023
Merged
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
14 changes: 12 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ jobs:
python-version: ['3.8', '3.9', '3.10', '3.11']
poetry-version: [1.5.1]
os: [ubuntu-latest, macos-latest, windows-latest]
extras: ['', 'mashumaro']
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
name: python ${{ matrix.python-version }} on ${{ matrix.os }}
name: 'python ${{ matrix.python-version }} on ${{ matrix.os }} [${{ matrix.extras }}]'
steps:
- uses: actions/[email protected]
- name: setting up python ${{ matrix.python-version }}
Expand All @@ -36,10 +37,19 @@ jobs:
uses: Gr1N/setup-poetry@v8
with:
poetry-version: ${{ matrix.poetry-version }}
- uses: allanchain/poetry-cache-action@release
- if: matrix.extras == ''
name: install dependencies without extras
uses: allanchain/poetry-cache-action@54a8477b640e34d95162dfe42d291c1c3f439adc
with:
ensure-module: green
install-args: -n -vv
- if: matrix.extras != ''
name: install dependencies with extra ${{ matrix.extras }}
uses: allanchain/poetry-cache-action@54a8477b640e34d95162dfe42d291c1c3f439adc
with:
cache-key-prefix: poetry-${{ matrix.extras }}
ensure-module: green
install-args: -n -vv -E ${{ matrix.extras }}
- name: running tests
run: poetry run green -vv
- name: building
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,8 @@ jobs:
uses: Gr1N/setup-poetry@v8
with:
poetry-version: ${{ matrix.poetry-version }}
- uses: allanchain/poetry-cache-action@release
with:
ensure-module: green
install-args: -n -vv
- name: install dependencies
run: poetry install -n -vv --all-extras
- name: running tests
run: poetry run green -vv
- name: install poetry git version plugin
Expand Down
4 changes: 2 additions & 2 deletions mutapath/immutapath.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

import filelock
import path
from path import multimethod
from path.classes import multimethod
from cached_property import cached_property
from filelock import SoftFileLock

Expand Down Expand Up @@ -204,7 +204,7 @@ def __exit__(self, *_):
self._contained.__exit__()

def __fspath__(self):
return self._contained.__fspath__()
return os.fspath(self._contained)

def __invert__(self):
"""Create a cloned :class:`~mutapath.MutaPath` from this immutable Path."""
Expand Down
19 changes: 11 additions & 8 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 7 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,25 @@ authors = ["matfax <[email protected]>"]
license = "lgpl-3.0"
keywords = ["pathlib", "mutable", "path"]
repository = "https://github.com/matfax/mutapath"
homepage = "https://github.com/matfax/mutapath"
documentation = "https://mutapath.readthedocs.io/en/latest/"
homepage = "https://mutapath.fax.fyi"
documentation = "https://mutapath.fax.fyi"
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.8"
singletons = "~0.2.5"
cached-property = "~1.5.2"
filelock = "~3.12.2"
path = ">=14,<=16.6.0"
path = ">=16.2,<=16.7.1"
mashumaro = {version = ">=3,<=3.8.1", optional = true}

[tool.poetry.extras]
mashumaro = ["mashumaro"]

[tool.poetry.dev-dependencies]
green = "~3.4.3"
coverage = "~7.2.7"
codecov = "~2.1.13"
mashumaro = "~3.8.1"
bandit = "~1.7.5"
black = "~23.7.0"

Expand Down
17 changes: 13 additions & 4 deletions tests/test_serializable.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
import unittest
from dataclasses import dataclass

from mashumaro import DataClassDictMixin
try:
from mashumaro import DataClassDictMixin

import_success = True
matfax marked this conversation as resolved.
Show resolved Hide resolved
except ImportError:
import_success = False

from mutapath import Path
from tests.helper import PathTest


@dataclass
class DataClass(DataClassDictMixin):
path: Path = Path()
if import_success:

@dataclass
matfax marked this conversation as resolved.
Show resolved Hide resolved
class DataClass(DataClassDictMixin):
path: Path = Path()


@unittest.skipIf(not import_success, "mashumaro extra is not installed")
class TestSerialization(PathTest):
def test_empty_serialization(self):
expected = {"path": ""}
Expand Down