Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

twill

Package Overview
Dependencies
Maintainers
2
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

twill - npm Package Compare versions

Comparing version
3.2.1
to
3.2.2
+5
-8
docs/changelog.rst

@@ -7,2 +7,7 @@ .. _changelog:

3.2.2 (released 2024-01-28)
---------------------------
* Fixes the broken interactive shell.
* Fixes 'run_file' when specifying files in a subdirectory without extension.
3.2.1 (released 2023-11-23)

@@ -46,3 +51,2 @@ ---------------------------

---------------------------
* Form numbers are now printed correctly with 'showforms' (#12).

@@ -52,3 +56,2 @@

---------------------------
* Save HTML file with browser encoding or as UTF-8 (#9).

@@ -59,3 +62,2 @@ * Do not modify root logger any more (#10).

---------------------------
* This version now also supports Python 3.10.

@@ -66,3 +68,2 @@ * The twill language now allows 8-bit letters to appear in strings unquoted.

-------------------------
* In this version we require Python 3.6 to 3.9.

@@ -76,3 +77,2 @@ If you still need support for Python 2 or Python 3.5,

---------------------------
* Backported the fixes in version 3.0.

@@ -82,3 +82,2 @@

---------------------------
* This version now also supports Python 3.9.

@@ -91,3 +90,2 @@ * 'tidy_should_exist' has been renamed ot 'require_tidy'.

---------------------------
* Fixes an issue with encoding declarations (#5).

@@ -97,3 +95,2 @@

-------------------------
This version is based on twill 1.8, which was a refactoring

@@ -100,0 +97,0 @@ of version 0.9 that used requests_ and lxml_ instead of mechanize_,

@@ -19,3 +19,3 @@ .. _developer:

.. _pytest: https://pytest.org/
.. _Quixote: http://quixote.ca/
.. _Quixote: https://github.com/nascheme/quixote

@@ -22,0 +22,0 @@ Licensing

Metadata-Version: 2.1
Name: twill
Version: 3.2.1
Version: 3.2.2
Summary: A web browsing and testing language

@@ -57,4 +57,4 @@ Author: C. Titus Brown, Ben R. Taylor, Christoph Zwerschke

Requires-Dist: lxml<5,>=4.9
Requires-Dist: httpx<1,>=0.25.0
Requires-Dist: pyparsing<4,>=3.0
Requires-Dist: httpx<1,>=0.26.0
Requires-Dist: pyparsing<4,>=3.1
Provides-Extra: docs

@@ -67,3 +67,3 @@ Requires-Dist: sphinx<6,>=5.2; extra == "docs"

Requires-Dist: tox<5,>=4; extra == "tests"
Requires-Dist: pytest<8,>=7.4; extra == "tests"
Requires-Dist: pytest<9,>=8; extra == "tests"
Requires-Dist: pytidylib<0.4,>=0.3; extra == "tests"

@@ -70,0 +70,0 @@ Requires-Dist: quixote<4,>=3.6; extra == "tests"

[project]
name = "twill"
version = "3.2.1"
version = "3.2.2"

@@ -43,4 +43,4 @@ description = "A web browsing and testing language"

"lxml >=4.9, <5",
"httpx >=0.25.0, <1",
"pyparsing >=3.0, <4",
"httpx >=0.26.0, <1",
"pyparsing >=3.1, <4",
]

@@ -58,3 +58,3 @@

"tox >=4, <5",
"pytest >=7.4, <8",
"pytest >=8, <9",
"pytidylib >=0.3, <0.4",

@@ -80,3 +80,3 @@ "quixote >=3.6, <4",

[tool.pytest.ini_options]
minversion = "7.4"
minversion = "8.0"
testpaths = [ "tests" ]

@@ -83,0 +83,0 @@

Metadata-Version: 2.1
Name: twill
Version: 3.2.1
Version: 3.2.2
Summary: A web browsing and testing language

@@ -57,4 +57,4 @@ Author: C. Titus Brown, Ben R. Taylor, Christoph Zwerschke

Requires-Dist: lxml<5,>=4.9
Requires-Dist: httpx<1,>=0.25.0
Requires-Dist: pyparsing<4,>=3.0
Requires-Dist: httpx<1,>=0.26.0
Requires-Dist: pyparsing<4,>=3.1
Provides-Extra: docs

@@ -67,3 +67,3 @@ Requires-Dist: sphinx<6,>=5.2; extra == "docs"

Requires-Dist: tox<5,>=4; extra == "tests"
Requires-Dist: pytest<8,>=7.4; extra == "tests"
Requires-Dist: pytest<9,>=8; extra == "tests"
Requires-Dist: pytidylib<0.4,>=0.3; extra == "tests"

@@ -70,0 +70,0 @@ Requires-Dist: quixote<4,>=3.6; extra == "tests"

lxml<5,>=4.9
httpx<1,>=0.25.0
pyparsing<4,>=3.0
httpx<1,>=0.26.0
pyparsing<4,>=3.1

@@ -11,3 +11,3 @@ [docs]

tox<5,>=4
pytest<8,>=7.4
pytest<9,>=8
pytidylib<0.4,>=0.3

@@ -14,0 +14,0 @@ quixote<4,>=3.6

@@ -320,3 +320,5 @@ """A command-line interpreter for twill.

def main() -> None: # noqa: C901, PLR0912, PLR0915
def main( # noqa: C901, PLR0912, PLR0915
argv: Optional[List[str]] = None,
) -> None:
"""Run as shell script."""

@@ -326,3 +328,4 @@ global interactive # noqa: PLW0603

# show the shorthand name for usage
argv = sys.argv
if argv is None:
argv = sys.argv
if argv[0].endswith("-script.py"):

@@ -459,2 +462,4 @@ argv[0] = argv[0].rsplit("-", 1)[0]

sys.exit(f"Invalid output file '{out_file}': {error}")
else:
output = None

@@ -461,0 +466,0 @@ set_output(output)

@@ -464,3 +464,5 @@ """Various ugly utility functions for twill.

"""Check if this is a hidden file (starting with a dot)."""
return filename not in (".", "..") and Path(filename).name.startswith(".")
return filename not in (os.curdir, os.pardir) and Path(
filename
).name.startswith(".")

@@ -475,10 +477,9 @@

"""Add the twill extension to the name of a script if necessary."""
if name not in (".", ".."):
if name not in (os.curdir, os.pardir):
path = Path(name)
twill_name = path.stem
ext = path.suffix
if not ext:
twill_name += twill_ext
if Path(twill_name).exists():
name = twill_name
if not (path.suffix or (path.exists() and not path.is_dir())):
twill_path = path.with_suffix(twill_ext)
if twill_path.exists() and not twill_path.is_dir():
path = twill_path
name = str(path)
return name

@@ -485,0 +486,0 @@

@@ -72,3 +72,3 @@ #!/usr/bin/env python3

def format(self) -> str: # noqa: A003
def format(self) -> str:
"""Format the error."""

@@ -173,3 +173,3 @@ request = get_request()

def exit(self) -> None: # noqa: A003
def exit(self) -> None:
"""Exit the application."""

@@ -176,0 +176,0 @@ raise SystemExit

@@ -13,3 +13,3 @@ import os

try:
files = gather_filenames((".",))
files = gather_filenames((os.curdir,))
if os.sep != "/":

@@ -16,0 +16,0 @@ files = [f.replace(os.sep, "/") for f in files]

@@ -0,1 +1,3 @@

from pathlib import Path
import pytest

@@ -6,2 +8,17 @@ from twill import utils

def test_is_hidden_filename():
is_hidden_filename = utils.is_hidden_filename
assert not is_hidden_filename("foo")
assert is_hidden_filename(".foo")
assert not is_hidden_filename(".foo/bar")
assert is_hidden_filename("foo/.bar")
def test_is_twill_filename():
is_twill_filename = utils.is_twill_filename
assert not is_twill_filename("foo")
assert is_twill_filename("foo.twill")
assert not is_twill_filename(".foo.twill")
def test_make_boolean():

@@ -23,2 +40,14 @@ make_boolean = utils.make_boolean

def test_make_twill_filename():
make_twill_filename = utils.make_twill_filename
assert make_twill_filename("test_foo") == "test_foo"
assert make_twill_filename("../tests/test_foo") == str(
Path("../tests/test_foo")
)
assert make_twill_filename("test_basic") == "test_basic.twill"
assert make_twill_filename("../tests/test_basic") == str(
Path("../tests/test_basic.twill")
)
def test_trunc():

@@ -25,0 +54,0 @@ trunc = utils.trunc

@@ -6,3 +6,3 @@ [tox]

basepython = python3.11
deps = ruff>=0.1.6,<0.2
deps = ruff>=0.1.14,<0.2
commands =

@@ -15,4 +15,4 @@ ruff check src/twill tests extras

deps =
mypy >= 1.6, <1.7
dnspython >=2.4, <3
mypy >= 1.8, <1.9
dnspython >=2.5, <3
types-lxml

@@ -19,0 +19,0 @@ types-setuptools