Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-libsass for openSUSE:Factory checked in at 2023-03-14 18:16:38 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-libsass (Old) and /work/SRC/openSUSE:Factory/.python-libsass.new.31432 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-libsass" Tue Mar 14 18:16:38 2023 rev:9 rq:1071186 version:0.22.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-libsass/python-libsass.changes 2021-08-06 22:45:22.318007679 +0200 +++ /work/SRC/openSUSE:Factory/.python-libsass.new.31432/python-libsass.changes 2023-03-14 18:16:41.495746849 +0100 @@ -1,0 +2,15 @@ +Mon Mar 13 16:27:27 UTC 2023 - Matej Cepl <mc...@suse.com> + +- Clean up the SPEC file and tighten it a bit to be less + all-accepting. + +------------------------------------------------------------------- +Mon Mar 13 13:15:05 UTC 2023 - pgaj...@suse.com + +- version update to 0.22.0 + - Remove python 2.x support [:issue:`373` by anthony sottile]. + - Remove deprecated ``sassc`` cli [:issue:`379` by anthony sottile]. +- python-six is not required +- do not conflict with sassc package + +------------------------------------------------------------------- Old: ---- 0.21.0.tar.gz New: ---- 0.22.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-libsass.spec ++++++ --- /var/tmp/diff_new_pack.NCaK32/_old 2023-03-14 18:16:42.063749886 +0100 +++ /var/tmp/diff_new_pack.NCaK32/_new 2023-03-14 18:16:42.067749906 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-libsass # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,9 +17,8 @@ %define _name libsass-python -%{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-libsass -Version: 0.21.0 +Version: 0.22.0 Release: 0 Summary: Python binding for libsass License: MIT @@ -29,17 +28,13 @@ BuildRequires: %{python_module Cython} BuildRequires: %{python_module devel} BuildRequires: %{python_module setuptools} -BuildRequires: %{python_module six} BuildRequires: fdupes BuildRequires: gcc-c++ BuildRequires: libsass-devel >= 3.6.4 BuildRequires: python-rpm-macros Requires: python-setuptools -Requires: python-six Requires(post): update-alternatives Requires(postun):update-alternatives -# Both are providing sassc binary with different parameters -Conflicts: sassc # SECTION test requirements BuildRequires: %{python_module Werkzeug} BuildRequires: %{python_module pytest} @@ -54,30 +49,37 @@ %setup -q -n libsass-python-%{version} %build +sed -i -e '/^#!\//, 1d' *.py export SYSTEM_SASS=true %python_build %install export SYSTEM_SASS=true %python_install -%python_clone -a %{buildroot}%{_bindir}/sassc %python_clone -a %{buildroot}%{_bindir}/pysassc -%python_expand %fdupes %{buildroot}%{$python_sitearch} +%{python_expand \ +# We don't want to install tests +rm %{buildroot}%{$python_sitearch}/sasstests.py \ + %{buildroot}%{$python_sitearch}/__pycache__/sasstests.*.pyc +%fdupes %{buildroot}%{$python_sitearch} +} %check %pytest_arch sasstests.py %post -%python_install_alternative sassc %python_install_alternative pysassc %postun -%python_uninstall_alternative sassc %python_uninstall_alternative pysassc %files %{python_files} %python_alternative %{_bindir}/pysassc -%python_alternative %{_bindir}/sassc -%{python_sitearch}/* +%{python_sitearch}/pysassc.py +%{python_sitearch}/sass.py +%{python_sitearch}/_sass*.so +%{python_sitearch}/sassutils +%pycache_only %{python_sitearch}/__pycache__/*sass*.pyc +%{python_sitearch}/libsass-%{version}*-info %changelog ++++++ 0.21.0.tar.gz -> 0.22.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsass-python-0.21.0/.gitignore new/libsass-python-0.22.0/.gitignore --- old/libsass-python-0.21.0/.gitignore 2021-05-21 03:41:54.000000000 +0200 +++ new/libsass-python-0.22.0/.gitignore 2022-11-12 18:43:54.000000000 +0100 @@ -6,7 +6,6 @@ .*.swp .DS_Store ._.DS_Store -.pytest_cache/ .coverage .tox /.libsass-upstream-version diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsass-python-0.21.0/.gitmodules new/libsass-python-0.22.0/.gitmodules --- old/libsass-python-0.21.0/.gitmodules 2021-05-21 03:41:54.000000000 +0200 +++ new/libsass-python-0.22.0/.gitmodules 2022-11-12 18:43:54.000000000 +0100 @@ -1,3 +1,3 @@ [submodule "libsass"] path = libsass -url = git://github.com/sass/libsass.git +url = https://github.com/sass/libsass diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsass-python-0.21.0/.pre-commit-config.yaml new/libsass-python-0.22.0/.pre-commit-config.yaml --- old/libsass-python-0.21.0/.pre-commit-config.yaml 2021-05-21 03:41:54.000000000 +0200 +++ new/libsass-python-0.22.0/.pre-commit-config.yaml 2022-11-12 18:43:54.000000000 +0100 @@ -1,21 +1,35 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.0.1 + rev: v4.3.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer - id: check-yaml - id: debug-statements -- repo: https://github.com/PyCQA/flake8 - rev: 3.9.2 + - id: double-quote-string-fixer + - id: name-tests-test + - id: requirements-txt-fixer +- repo: https://github.com/asottile/reorder_python_imports + rev: v3.8.5 hooks: - - id: flake8 - exclude: ^docs/conf.py + - id: reorder-python-imports + args: [--py36-plus] +- repo: https://github.com/asottile/add-trailing-comma + rev: v2.3.0 + hooks: + - id: add-trailing-comma + args: [--py36-plus] - repo: https://github.com/asottile/pyupgrade - rev: v2.16.0 + rev: v3.1.0 hooks: - id: pyupgrade -- repo: https://github.com/asottile/add-trailing-comma - rev: v2.1.0 + args: [--py36-plus] +- repo: https://github.com/pre-commit/mirrors-autopep8 + rev: v1.7.0 hooks: - - id: add-trailing-comma + - id: autopep8 +- repo: https://github.com/PyCQA/flake8 + rev: 5.0.4 + hooks: + - id: flake8 + exclude: ^docs/conf.py diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsass-python-0.21.0/CONTRIBUTING.rst new/libsass-python-0.22.0/CONTRIBUTING.rst --- old/libsass-python-0.21.0/CONTRIBUTING.rst 2021-05-21 03:41:54.000000000 +0200 +++ new/libsass-python-0.22.0/CONTRIBUTING.rst 2022-11-12 18:43:54.000000000 +0100 @@ -26,7 +26,7 @@ - All commits will be tested by `Azure Pipelines`_ (Linux and Windows). .. _tox: https://tox.readthedocs.io/ -.. _`Azure Pipelines`: https://dev.azure.com/asottile/asottile/_build/latest?definitionId=22&branchName=master +.. _`Azure Pipelines`: https://dev.azure.com/asottile/asottile/_build/latest?definitionId=22&branchName=main Maintainer's guide diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsass-python-0.21.0/README.rst new/libsass-python-0.22.0/README.rst --- old/libsass-python-0.21.0/README.rst 2021-05-21 03:41:54.000000000 +0200 +++ new/libsass-python-0.22.0/README.rst 2022-11-12 18:43:54.000000000 +0100 @@ -5,16 +5,16 @@ :alt: PyPI :target: https://pypi.org/pypi/libsass/ -.. image:: https://dev.azure.com/asottile/asottile/_apis/build/status/sass.libsass-python?branchName=master - :target: https://dev.azure.com/asottile/asottile/_build/latest?definitionId=22&branchName=master +.. image:: https://dev.azure.com/asottile/asottile/_apis/build/status/sass.libsass-python?branchName=main + :target: https://dev.azure.com/asottile/asottile/_build/latest?definitionId=22&branchName=main :alt: Build Status -.. image:: https://img.shields.io/azure-devops/coverage/asottile/asottile/22/master.svg - :target: https://dev.azure.com/asottile/asottile/_build/latest?definitionId=22&branchName=master +.. image:: https://img.shields.io/azure-devops/coverage/asottile/asottile/22/main.svg + :target: https://dev.azure.com/asottile/asottile/_build/latest?definitionId=22&branchName=main :alt: Coverage Status -.. image:: https://results.pre-commit.ci/badge/github/sass/libsass-python/master.svg - :target: https://results.pre-commit.ci/latest/github/sass/libsass-python/master +.. image:: https://results.pre-commit.ci/badge/github/sass/libsass-python/main.svg + :target: https://results.pre-commit.ci/latest/github/sass/libsass-python/main :alt: pre-commit.ci status This package provides a simple Python extension module ``sass`` which is @@ -22,9 +22,9 @@ It's very straightforward and there isn't any headache related Python distribution/deployment. That means you can add just ``libsass`` into your ``setup.py``'s ``install_requires`` list or ``requirements.txt`` file. -Need no Ruby nor Node.js. +No need for Ruby nor Node.js. -It currently supports CPython 2.7, 3.6--3.8, and PyPy 2.3+! +It currently supports CPython 3.6+, and PyPy 3! .. _Sass: https://sass-lang.com/ .. _LibSass: https://github.com/sass/libsass diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsass-python-0.21.0/azure-pipelines.yml new/libsass-python-0.22.0/azure-pipelines.yml --- old/libsass-python-0.21.0/azure-pipelines.yml 2021-05-21 03:41:54.000000000 +0200 +++ new/libsass-python-0.22.0/azure-pipelines.yml 2022-11-12 18:43:54.000000000 +0100 @@ -1,6 +1,6 @@ trigger: branches: - include: [master, test-me-*] + include: [main, test-me-*] tags: include: ['*'] @@ -13,30 +13,21 @@ type: github endpoint: github name: asottile/azure-pipeline-templates - ref: refs/tags/v2.1.0 + ref: refs/tags/v2.4.0 jobs: - template: job--python-tox.yml@asottile parameters: - toxenvs: [py27, py36] + toxenvs: [py37] os: macos wheel_tags: true - template: job--python-tox.yml@asottile parameters: - toxenvs: [py27] + toxenvs: [py37] os: windows architectures: [x64, x86] - name_postfix: _py27 wheel_tags: true - pre_test: - - script: rm -rf libsass/test - template: job--python-tox.yml@asottile parameters: - toxenvs: [py36] - os: windows - architectures: [x64, x86] - wheel_tags: true -- template: job--python-tox.yml@asottile - parameters: - toxenvs: [pypy, pypy3, py27, py36, py37, py38, py39] + toxenvs: [pypy3, py36, py37, py38, py39] os: linux diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsass-python-0.21.0/bin/build-manylinux-wheels new/libsass-python-0.22.0/bin/build-manylinux-wheels --- old/libsass-python-0.21.0/bin/build-manylinux-wheels 2021-05-21 03:41:54.000000000 +0200 +++ new/libsass-python-0.22.0/bin/build-manylinux-wheels 2022-11-12 18:43:54.000000000 +0100 @@ -23,13 +23,13 @@ os.makedirs('dist', exist_ok=True) for python in ('cp27-cp27mu', 'cp36-cp36m'): with tempfile.TemporaryDirectory() as work: - pip = '/opt/python/{}/bin/pip'.format(python) + pip = f'/opt/python/{python}/bin/pip' check_call( 'docker', 'run', '-ti', # Use this so the files are not owned by root - '--user', '{}:{}'.format(os.getuid(), os.getgid()), + '--user', f'{os.getuid()}:{os.getgid()}', # We'll do building in /work and copy results to /dist - '-v', '{}:/work:rw'.format(work), + '-v', f'{work}:/work:rw', '-v', '{}:/dist:rw'.format(os.path.abspath('dist')), 'quay.io/pypa/manylinux1_x86_64:latest', 'bash', '-exc', @@ -40,4 +40,4 @@ if __name__ == '__main__': - exit(main()) + raise SystemExit(main()) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsass-python-0.21.0/bin/download-windows-wheels new/libsass-python-0.22.0/bin/download-windows-wheels --- old/libsass-python-0.21.0/bin/download-windows-wheels 2021-05-21 03:41:54.000000000 +0200 +++ new/libsass-python-0.22.0/bin/download-windows-wheels 2022-11-12 18:43:54.000000000 +0100 @@ -56,4 +56,4 @@ if __name__ == '__main__': - exit(main()) + raise SystemExit(main()) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsass-python-0.21.0/docs/changes.rst new/libsass-python-0.22.0/docs/changes.rst --- old/libsass-python-0.21.0/docs/changes.rst 2021-05-21 03:41:54.000000000 +0200 +++ new/libsass-python-0.22.0/docs/changes.rst 2022-11-12 18:43:54.000000000 +0100 @@ -1,7 +1,15 @@ Changelog ========= -Version 0.21.1 +Version 0.22.0 +-------------- + +Released on November 12, 2022. + +- Remove python 2.x support [:issue:`373` by anthony sottile]. +- Remove deprecated ``sassc`` cli [:issue:`379` by anthony sottile]. + +Version 0.21.0 -------------- Released on May 20, 2021. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsass-python-0.21.0/docs/conf.py new/libsass-python-0.22.0/docs/conf.py --- old/libsass-python-0.21.0/docs/conf.py 2021-05-21 03:41:54.000000000 +0200 +++ new/libsass-python-0.22.0/docs/conf.py 2022-11-12 18:43:54.000000000 +0100 @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # # libsass documentation build configuration file, created by # sphinx-quickstart on Sun Aug 19 22:45:57 2012. @@ -14,12 +13,13 @@ import sys import warnings +import sass + # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. sys.path.insert(0, os.path.abspath('..')) -import sass # -- General configuration ----------------------------------------------------- @@ -48,8 +48,8 @@ master_doc = 'index' # General information about the project. -project = u'libsass' -copyright = u'2012, Hong Minhee' +project = 'libsass' +copyright = '2012, Hong Minhee' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the @@ -180,23 +180,23 @@ # -- Options for LaTeX output -------------------------------------------------- latex_elements = { -# The paper size ('letterpaper' or 'a4paper'). -#'papersize': 'letterpaper', + # The paper size ('letterpaper' or 'a4paper'). + # 'papersize': 'letterpaper', -# The font size ('10pt', '11pt' or '12pt'). -#'pointsize': '10pt', + # The font size ('10pt', '11pt' or '12pt'). + # 'pointsize': '10pt', -# Additional stuff for the LaTeX preamble. -#'preamble': '', + # Additional stuff for the LaTeX preamble. + # 'preamble': '', } # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass [howto/manual]). latex_documents = [ - ( - 'index', 'libsass.tex', u'libsass Documentation', - u'Hong Minhee', 'manual', - ), + ( + 'index', 'libsass.tex', 'libsass Documentation', + 'Hong Minhee', 'manual', + ), ] # The name of an image file (relative to this directory) to place at the top of @@ -226,8 +226,8 @@ # (source start file, name, description, authors, manual section). man_pages = [ ( - 'index', 'libsass', u'libsass Documentation', - [u'Hong Minhee'], 1, + 'index', 'libsass', 'libsass Documentation', + ['Hong Minhee'], 1, ), ] @@ -241,11 +241,11 @@ # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ - ( - 'index', 'libsass', u'libsass Documentation', - u'Hong Minhee', 'libsass', 'One line description of project.', - 'Miscellaneous', - ), + ( + 'index', 'libsass', 'libsass Documentation', + 'Hong Minhee', 'libsass', 'One line description of project.', + 'Miscellaneous', + ), ] # Documents to append as an appendix to all manuals. @@ -269,7 +269,7 @@ extlinks = { 'issue': ('https://github.com/sass/libsass-python/issues/%s', '#'), 'branch': ( - 'https://github.com/sass/libsass-python/compare/master...%s', + 'https://github.com/sass/libsass-python/compare/main...%s', '', ), 'commit': ('https://github.com/sass/libsass-python/commit/%s', ''), diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsass-python-0.21.0/docs/index.rst new/libsass-python-0.22.0/docs/index.rst --- old/libsass-python-0.21.0/docs/index.rst 2021-05-21 03:41:54.000000000 +0200 +++ new/libsass-python-0.22.0/docs/index.rst 2022-11-12 18:43:54.000000000 +0100 @@ -8,7 +8,7 @@ your :file:`setup.py`'s ``install_requires`` list or :file:`requirements.txt` file. -It currently supports CPython 2.6, 2.7, 3.5--3.7, and PyPy 2.3+! +It currently supports CPython 3.6+ and PyPy 3! .. _Sass: https://sass-lang.com/ .. _LibSass: https://github.com/sass/libsass @@ -133,17 +133,17 @@ https://github.com/sass/libsass-python Azure Pipelines CI (linux + windows) - https://dev.azure.com/asottile/asottile/_build/latest?definitionId=22&branchName=master + https://dev.azure.com/asottile/asottile/_build/latest?definitionId=22&branchName=main - .. image:: https://dev.azure.com/asottile/asottile/_apis/build/status/sass.libsass-python?branchName=master - :target: https://dev.azure.com/asottile/asottile/_build/latest?definitionId=22&branchName=master + .. image:: https://dev.azure.com/asottile/asottile/_apis/build/status/sass.libsass-python?branchName=main + :target: https://dev.azure.com/asottile/asottile/_build/latest?definitionId=22&branchName=main :alt: Build Status Azure Pipelines Coverage (Test coverage) - https://dev.azure.com/asottile/asottile/_build/latest?definitionId=22&branchName=master + https://dev.azure.com/asottile/asottile/_build/latest?definitionId=22&branchName=main - .. image:: https://img.shields.io/azure-devops/coverage/asottile/asottile/22/master.svg - :target: https://dev.azure.com/asottile/asottile/_build/latest?definitionId=22&branchName=master + .. image:: https://img.shields.io/azure-devops/coverage/asottile/asottile/22/main.svg + :target: https://dev.azure.com/asottile/asottile/_build/latest?definitionId=22&branchName=main :alt: Coverage Status PyPI diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsass-python-0.21.0/pysassc.py new/libsass-python-0.22.0/pysassc.py --- old/libsass-python-0.21.0/pysassc.py 2021-05-21 03:41:54.000000000 +0200 +++ new/libsass-python-0.22.0/pysassc.py 2022-11-12 18:43:54.000000000 +0100 @@ -88,10 +88,7 @@ .. _SassC: https://github.com/sass/sassc """ -from __future__ import print_function - import functools -import io import optparse import sys import warnings @@ -219,7 +216,7 @@ include_paths=options.include_paths, precision=options.precision, ) - except (IOError, OSError) as e: + except OSError as e: error(e) return 3 except sass.CompileError as e: @@ -229,10 +226,10 @@ if len(args) < 2: print(css, file=stdout) else: - with io.open(args[1], 'w', encoding='utf-8', newline='') as f: + with open(args[1], 'w', encoding='utf-8', newline='') as f: f.write(css) if source_map_filename: - with io.open( + with open( source_map_filename, 'w', encoding='utf-8', newline='', ) as f: f.write(source_map) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsass-python-0.21.0/sass.py new/libsass-python-0.22.0/sass.py --- old/libsass-python-0.21.0/sass.py 2021-05-21 03:41:54.000000000 +0200 +++ new/libsass-python-0.22.0/sass.py 2022-11-12 18:43:54.000000000 +0100 @@ -10,28 +10,21 @@ 'a b {\n color: blue; }\n' """ -from __future__ import absolute_import - -import collections +import collections.abc import inspect -import io -import os import os.path import re import sys import warnings -from six import string_types, text_type, PY2 - import _sass -from sassutils._compat import collections_abc __all__ = ( 'MODES', 'OUTPUT_STYLES', 'SOURCE_COMMENTS', 'CompileError', 'SassColor', 'SassError', 'SassFunction', 'SassList', 'SassMap', 'SassNumber', 'SassWarning', 'and_join', 'compile', 'libsass_version', ) -__version__ = '0.21.0' +__version__ = '0.22.0' libsass_version = _sass.libsass_version @@ -52,19 +45,19 @@ def to_native_s(s): - if isinstance(s, bytes) and not PY2: # pragma: no cover (py3) - s = s.decode('UTF-8') - elif isinstance(s, text_type) and PY2: # pragma: no cover (py2) - s = s.encode('UTF-8') - return s + if isinstance(s, bytes): + return s.decode('UTF-8') + else: + return s class CompileError(ValueError): """The exception type that is raised by :func:`compile()`. It is a subtype of :exc:`exceptions.ValueError`. """ + def __init__(self, msg): - super(CompileError, self).__init__(to_native_s(msg)) + super().__init__(to_native_s(msg)) def mkdirp(path): @@ -76,7 +69,7 @@ raise -class SassFunction(object): +class SassFunction: """Custom function for Sass. It can be instantiated using :meth:`from_lambda()` and :meth:`from_named_function()` as well. @@ -107,16 +100,10 @@ :rtype: :class:`SassFunction` """ - if PY2: # pragma: no cover - a = inspect.getargspec(lambda_) - varargs, varkw, defaults, kwonlyargs = ( - a.varargs, a.keywords, a.defaults, None, - ) - else: # pragma: no cover - a = inspect.getfullargspec(lambda_) - varargs, varkw, defaults, kwonlyargs = ( - a.varargs, a.varkw, a.defaults, a.kwonlyargs, - ) + a = inspect.getfullargspec(lambda_) + varargs, varkw, defaults, kwonlyargs = ( + a.varargs, a.varkw, a.defaults, a.kwonlyargs, + ) if varargs or varkw or defaults or kwonlyargs: raise TypeError( @@ -142,9 +129,9 @@ return cls.from_lambda(function.__name__, function) def __init__(self, name, arguments, callable_): - if not isinstance(name, string_types): + if not isinstance(name, str): raise TypeError('name must be a string, not ' + repr(name)) - elif not isinstance(arguments, collections_abc.Sequence): + elif not isinstance(arguments, collections.abc.Sequence): raise TypeError( 'arguments must be a sequence, not ' + repr(arguments), @@ -263,7 +250,7 @@ if s: v = v.decode('UTF-8') mkdirp(os.path.dirname(output_filename)) - with io.open( + with open( output_filename, 'w', encoding='UTF-8', newline='', ) as output_file: output_file.write(v) @@ -277,7 +264,7 @@ raise TypeError( '{}() got unexpected keyword argument(s) {}'.format( func.__name__, - ', '.join("'{}'".format(arg) for arg in sorted(kwargs)), + ', '.join(f"'{arg}'" for arg in sorted(kwargs)), ), ) @@ -563,7 +550,7 @@ ) precision = kwargs.pop('precision', 5) output_style = kwargs.pop('output_style', 'nested') - if not isinstance(output_style, string_types): + if not isinstance(output_style, str): raise TypeError( 'output_style must be a string, not ' + repr(output_style), @@ -586,7 +573,7 @@ elif source_comments in ('line_numbers', 'default'): deprecation_message = ( 'you can simply pass True to ' - "source_comments instead of " + + 'source_comments instead of ' + repr(source_comments) ) source_comments = True @@ -612,9 +599,9 @@ def _get_file_arg(key): ret = kwargs.pop(key, None) - if ret is not None and not isinstance(ret, string_types): - raise TypeError('{} must be a string, not {!r}'.format(key, ret)) - elif isinstance(ret, text_type): + if ret is not None and not isinstance(ret, str): + raise TypeError(f'{key} must be a string, not {ret!r}') + elif isinstance(ret, str): ret = ret.encode(fs_encoding) if ret and 'filename' not in modes: raise CompileError( @@ -631,25 +618,25 @@ omit_source_map_url = kwargs.pop('omit_source_map_url', False) source_map_root = kwargs.pop('source_map_root', None) - if isinstance(source_map_root, text_type): + if isinstance(source_map_root, str): source_map_root = source_map_root.encode('utf-8') # #208: cwd is always included in include paths include_paths = (os.getcwd(),) include_paths += tuple(kwargs.pop('include_paths', ()) or ()) include_paths = os.pathsep.join(include_paths) - if isinstance(include_paths, text_type): + if isinstance(include_paths, str): include_paths = include_paths.encode(fs_encoding) custom_functions = kwargs.pop('custom_functions', ()) - if isinstance(custom_functions, collections_abc.Mapping): + if isinstance(custom_functions, collections.abc.Mapping): custom_functions = [ SassFunction.from_lambda(name, lambda_) for name, lambda_ in custom_functions.items() ] elif isinstance( custom_functions, - (collections_abc.Set, collections_abc.Sequence), + (collections.abc.Set, collections.abc.Sequence), ): custom_functions = [ func if isinstance(func, SassFunction) @@ -676,7 +663,7 @@ if 'string' in modes: string = kwargs.pop('string') - if isinstance(string, text_type): + if isinstance(string, str): string = string.encode('utf-8') indented = kwargs.pop('indented', False) if not isinstance(indented, bool): @@ -695,11 +682,11 @@ return v.decode('utf-8') elif 'filename' in modes: filename = kwargs.pop('filename') - if not isinstance(filename, string_types): + if not isinstance(filename, str): raise TypeError('filename must be a string, not ' + repr(filename)) elif not os.path.isfile(filename): - raise IOError('{!r} seems not a file'.format(filename)) - elif isinstance(filename, text_type): + raise OSError(f'{filename!r} seems not a file') + elif isinstance(filename, str): filename = filename.encode(fs_encoding) _check_no_remaining_kwargs(compile, kwargs) s, v, source_map = _sass.compile_filename( @@ -780,9 +767,9 @@ def __new__(cls, value, unit): value = float(value) - if not isinstance(unit, text_type): + if not isinstance(unit, str): unit = unit.decode('UTF-8') - return super(SassNumber, cls).__new__(cls, value, unit) + return super().__new__(cls, value, unit) class SassColor(collections.namedtuple('SassColor', ('r', 'g', 'b', 'a'))): @@ -792,7 +779,7 @@ g = float(g) b = float(b) a = float(a) - return super(SassColor, cls).__new__(cls, r, g, b, a) + return super().__new__(cls, r, g, b, a) SASS_SEPARATOR_COMMA = collections.namedtuple('SASS_SEPARATOR_COMMA', ())() @@ -802,7 +789,7 @@ class SassList( collections.namedtuple( - 'SassList', ('items', 'separator', 'bracketed'), + 'SassList', ('items', 'separator', 'bracketed'), ), ): @@ -810,26 +797,26 @@ items = tuple(items) assert separator in SEPARATORS, separator assert isinstance(bracketed, bool), bracketed - return super(SassList, cls).__new__(cls, items, separator, bracketed) + return super().__new__(cls, items, separator, bracketed) class SassError(collections.namedtuple('SassError', ('msg',))): def __new__(cls, msg): - if not isinstance(msg, text_type): + if not isinstance(msg, str): msg = msg.decode('UTF-8') - return super(SassError, cls).__new__(cls, msg) + return super().__new__(cls, msg) class SassWarning(collections.namedtuple('SassWarning', ('msg',))): def __new__(cls, msg): - if not isinstance(msg, text_type): + if not isinstance(msg, str): msg = msg.decode('UTF-8') - return super(SassWarning, cls).__new__(cls, msg) + return super().__new__(cls, msg) -class SassMap(collections_abc.Mapping): +class SassMap(collections.abc.Mapping): """Because sass maps can have mapping types as keys, we need an immutable hashable mapping type. @@ -858,7 +845,7 @@ # Our interface def __repr__(self): - return '{}({})'.format(type(self).__name__, frozenset(self.items())) + return f'{type(self).__name__}({frozenset(self.items())})' def __hash__(self): return self._hash diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsass-python-0.21.0/sassc.py new/libsass-python-0.22.0/sassc.py --- old/libsass-python-0.21.0/sassc.py 2021-05-21 03:41:54.000000000 +0200 +++ new/libsass-python-0.22.0/sassc.py 1970-01-01 01:00:00.000000000 +0100 @@ -1,15 +0,0 @@ -import warnings - -import pysassc - - -def main(*args, **kwargs): - warnings.warn( - 'The `sassc` entrypoint is deprecated, please use `pysassc`', - FutureWarning, - ), - return pysassc.main(*args, **kwargs) - - -if __name__ == '__main__': - exit(main()) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsass-python-0.21.0/sasstests.py new/libsass-python-0.22.0/sasstests.py --- old/libsass-python-0.21.0/sasstests.py 2021-05-21 03:41:54.000000000 +0200 +++ new/libsass-python-0.22.0/sasstests.py 2022-11-12 18:43:54.000000000 +0100 @@ -1,12 +1,10 @@ -# -*- coding: utf-8 -*- - import base64 +import collections.abc import contextlib import functools import glob -import json import io -import os +import json import os.path import re import shutil @@ -17,15 +15,13 @@ import unittest import pytest -from six import StringIO, b, string_types, text_type from werkzeug.test import Client from werkzeug.wrappers import Response import pysassc import sass -import sassc -from sassutils._compat import collections_abc -from sassutils.builder import Manifest, build_directory +from sassutils.builder import build_directory +from sassutils.builder import Manifest from sassutils.wsgi import SassMiddleware @@ -71,7 +67,7 @@ ), } -with io.open('test/a.scss', newline='') as f: +with open('test/a.scss', newline='') as f: A_EXPECTED_MAP_CONTENTS = dict(A_EXPECTED_MAP, sourcesContent=[f.read()]) B_EXPECTED_CSS = '''\ @@ -95,7 +91,7 @@ color: green; } ''' -D_EXPECTED_CSS = u'''\ +D_EXPECTED_CSS = '''\ @charset "UTF-8"; body { background-color: green; } @@ -103,7 +99,7 @@ font: 'ëëê³ ë', sans-serif; } ''' -D_EXPECTED_CSS_WITH_MAP = u'''\ +D_EXPECTED_CSS_WITH_MAP = '''\ @charset "UTF-8"; body { background-color: green; } @@ -149,7 +145,7 @@ def _map_in_output_dir(s): def cb(match): filename = os.path.basename(match.group(1)) - return '/*# sourceMappingURL={} */'.format(filename) + return f'/*# sourceMappingURL={filename} */' return re_sourcemap_url.sub(cb, s) @@ -163,9 +159,9 @@ class BaseTestCase(unittest.TestCase): def assert_source_map_equal(self, expected, actual): - if isinstance(expected, string_types): + if isinstance(expected, str): expected = json.loads(expected) - if isinstance(actual, string_types): + if isinstance(actual, str): actual = json.loads(actual) assert expected == actual @@ -175,7 +171,7 @@ tree = json.load(f) except ValueError as e: # pragma: no cover f.seek(0) - msg = '{!s}\n\n{}:\n\n{}'.format(e, filename, f.read()) + msg = f'{e!s}\n\n{filename}:\n\n{f.read()}' raise ValueError(msg) self.assert_source_map_equal(expected, tree) @@ -196,7 +192,7 @@ assert re.match(r'^\d+\.\d+\.\d+$', sass.__version__) def test_output_styles(self): - assert isinstance(sass.OUTPUT_STYLES, collections_abc.Mapping) + assert isinstance(sass.OUTPUT_STYLES, collections.abc.Mapping) assert 'nested' in sass.OUTPUT_STYLES def test_and_join(self): @@ -294,9 +290,9 @@ a b { color: blue; } ''' - actual = sass.compile(string=u'a { color: blue; } /* ì ëì½ë */') + actual = sass.compile(string='a { color: blue; } /* ì ëì½ë */') self.assertEqual( - u'''@charset "UTF-8"; + '''@charset "UTF-8"; a { color: blue; } @@ -330,11 +326,11 @@ def test_importer_one_arg(self): """Demonstrates one-arg importers + chaining.""" def importer_returning_one_argument(path): - assert type(path) is text_type + assert type(path) is str return ( # Trigger the import of an actual file ('test/b.scss',), - (path, '.{0}-one-arg {{ color: blue; }}'.format(path)), + (path, f'.{path}-one-arg {{ color: blue; }}'), ) ret = sass.compile( @@ -428,11 +424,11 @@ path, 'a { color: red; }', json.dumps({ - "version": 3, - "sources": [ - path + ".db", + 'version': 3, + 'sources': [ + path + '.db', ], - "mappings": ";AAAA,CAAC,CAAC;EAAE,KAAK,EAAE,GAAI,GAAI", + 'mappings': ';AAAA,CAAC,CAAC;EAAE,KAAK,EAAE,GAAI,GAAI', }), ), ) @@ -448,17 +444,17 @@ def test_importers_raises_exception(self): def importer(path): - raise ValueError('Bad path: {}'.format(path)) + raise ValueError(f'Bad path: {path}') with assert_raises_compile_error( RegexMatcher( - r'^Error: \n' - r' Traceback \(most recent call last\):\n' - r'.+' - r'ValueError: Bad path: hi\n' - r' on line 1:9 of stdin\n' - r'>> @import "hi";\n' - r' --------\^\n', + r'^Error: \n' + r' Traceback \(most recent call last\):\n' + r'.+' + r'ValueError: Bad path: hi\n' + r' on line 1:9 of stdin\n' + r'>> @import "hi";\n' + r' --------\^\n', ), ): sass.compile(string='@import "hi";', importers=((0, importer),)) @@ -469,14 +465,14 @@ with assert_raises_compile_error( RegexMatcher( - r'^Error: \n' - r' Traceback \(most recent call last\):\n' - r'.+' - r'ValueError: Expected importer result to be a tuple of ' - r'length \(1, 2, 3\) but got 0: \(\)\n' - r' on line 1:9 of stdin\n' - r'>> @import "hi";\n' - r' --------\^\n', + r'^Error: \n' + r' Traceback \(most recent call last\):\n' + r'.+' + r'ValueError: Expected importer result to be a tuple of ' + r'length \(1, 2, 3\) but got 0: \(\)\n' + r' on line 1:9 of stdin\n' + r'>> @import "hi";\n' + r' --------\^\n', ), ): sass.compile(string='@import "hi";', importers=((0, importer),)) @@ -487,14 +483,14 @@ with assert_raises_compile_error( RegexMatcher( - r'^Error: \n' - r' Traceback \(most recent call last\):\n' - r'.+' - r'ValueError: Expected importer result to be a tuple of ' - r"length \(1, 2, 3\) but got 4: \('a', 'b', 'c', 'd'\)\n" - r' on line 1:9 of stdin\n' - r'>> @import "hi";\n' - r' --------\^\n', + r'^Error: \n' + r' Traceback \(most recent call last\):\n' + r'.+' + r'ValueError: Expected importer result to be a tuple of ' + r"length \(1, 2, 3\) but got 4: \('a', 'b', 'c', 'd'\)\n" + r' on line 1:9 of stdin\n' + r'>> @import "hi";\n' + r' --------\^\n', ), ): sass.compile(string='@import "hi";', importers=((0, importer),)) @@ -640,31 +636,31 @@ result_files = build_directory(self.sass_path, css_path) assert len(result_files) == 8 assert 'a.scss.css' == result_files['a.scss'] - with io.open( + with open( os.path.join(css_path, 'a.scss.css'), encoding='UTF-8', ) as f: css = f.read() assert A_EXPECTED_CSS == css assert 'b.scss.css' == result_files['b.scss'] - with io.open( + with open( os.path.join(css_path, 'b.scss.css'), encoding='UTF-8', ) as f: css = f.read() assert B_EXPECTED_CSS == css assert 'c.scss.css' == result_files['c.scss'] - with io.open( + with open( os.path.join(css_path, 'c.scss.css'), encoding='UTF-8', ) as f: css = f.read() assert C_EXPECTED_CSS == css assert 'd.scss.css' == result_files['d.scss'] - with io.open( + with open( os.path.join(css_path, 'd.scss.css'), encoding='UTF-8', ) as f: css = f.read() assert D_EXPECTED_CSS == css assert 'e.scss.css' == result_files['e.scss'] - with io.open( + with open( os.path.join(css_path, 'e.scss.css'), encoding='UTF-8', ) as f: css = f.read() @@ -673,7 +669,7 @@ os.path.join('subdir', 'recur.scss.css'), result_files[os.path.join('subdir', 'recur.scss')], ) - with io.open( + with open( os.path.join(css_path, 'g.scss.css'), encoding='UTF-8', ) as f: css = f.read() @@ -683,12 +679,12 @@ result_files[os.path.join('subdir', 'recur.scss')], ) assert 'h.sass.css' == result_files['h.sass'] - with io.open( + with open( os.path.join(css_path, 'h.sass.css'), encoding='UTF-8', ) as f: css = f.read() assert H_EXPECTED_CSS == css - with io.open( + with open( os.path.join(css_path, 'subdir', 'recur.scss.css'), encoding='UTF-8', ) as f: @@ -703,7 +699,7 @@ ) assert len(result_files) == 8 assert 'a.scss.css' == result_files['a.scss'] - with io.open( + with open( os.path.join(css_path, 'a.scss.css'), encoding='UTF-8', ) as f: css = f.read() @@ -755,7 +751,7 @@ with open(os.path.join(d, 'css', 'a.scss.css')) as f: assert A_EXPECTED_CSS == f.read() m.build_one(d, 'b.scss', source_map=True) - with io.open( + with open( os.path.join(d, 'css', 'b.scss.css'), encoding='UTF-8', ) as f: assert f.read() == _map_in_output_dir(B_EXPECTED_CSS_WITH_MAP) @@ -773,7 +769,7 @@ os.path.join(d, 'css', 'b.scss.css.map'), ) m.build_one(d, 'd.scss', source_map=True) - with io.open( + with open( os.path.join(d, 'css', 'd.scss.css'), encoding='UTF-8', ) as f: assert f.read() == _map_in_output_dir(D_EXPECTED_CSS_WITH_MAP) @@ -838,7 +834,7 @@ r = client.get('/static/a.scss.css') assert r.status_code == 200 self.assertEqual( - b(_map_in_output_dir(A_EXPECTED_CSS_WITH_MAP)), + _map_in_output_dir(A_EXPECTED_CSS_WITH_MAP).encode(), r.data, ) assert r.mimetype == 'text/css' @@ -903,7 +899,7 @@ return os.path.join( os.path.dirname(__file__), 'testpkg', 'testpkg', 'static', 'css', - *args + *args, ) def list_built_css(self): @@ -942,8 +938,8 @@ class SasscTestCase(BaseTestCase): def setUp(self): - self.out = StringIO() - self.err = StringIO() + self.out = io.StringIO() + self.err = io.StringIO() def test_no_args(self): exit_code = pysassc.main(['pysassc'], self.out, self.err) @@ -973,17 +969,6 @@ assert self.err.getvalue() == '' assert A_EXPECTED_CSS.strip() == self.out.getvalue().strip() - def test_sassc_stdout(self): - with pytest.warns(FutureWarning) as warninfo: - exit_code = sassc.main( - ['sassc', 'test/a.scss'], - self.out, self.err, - ) - assert 'use `pysassc`' in warninfo[0].message.args[0] - assert exit_code == 0 - assert self.err.getvalue() == '' - assert A_EXPECTED_CSS.strip() == self.out.getvalue().strip() - def test_pysassc_output(self): fd, tmp = tempfile.mkstemp('.css') try: @@ -995,7 +980,7 @@ assert exit_code == 0 assert self.err.getvalue() == '' assert self.out.getvalue() == '' - with io.open(tmp, encoding='UTF-8', newline='') as f: + with open(tmp, encoding='UTF-8', newline='') as f: assert A_EXPECTED_CSS.strip() == f.read().strip() finally: os.remove(tmp) @@ -1011,7 +996,7 @@ assert exit_code == 0 assert self.err.getvalue() == '' assert self.out.getvalue() == '' - with io.open(tmp, encoding='UTF-8') as f: + with open(tmp, encoding='UTF-8') as f: assert D_EXPECTED_CSS.strip() == f.read().strip() finally: os.remove(tmp) @@ -1093,10 +1078,10 @@ input_dir = os.path.join(tmpdir, 'input') output_dir = os.path.join(tmpdir, 'output') os.makedirs(input_dir) - with io.open( + with open( os.path.join(input_dir, 'test.scss'), 'w', encoding='UTF-8', ) as f: - f.write(u'a { content: "â"; }') + f.write('a { content: "â"; }') # Raised a UnicodeEncodeError in py2 before #82 (issue #72) # Also raised a UnicodeEncodeError in py3 if the default encoding # couldn't represent it (such as cp1252 on windows) @@ -1131,7 +1116,7 @@ class SassFunctionTest(unittest.TestCase): def test_from_lambda(self): - lambda_ = lambda abc, d: None # pragma: no branch # noqa: E731 + def lambda_(abc, d): return None # pragma: no branch # noqa: E731 sf = sass.SassFunction.from_lambda('func_name', lambda_) assert 'func_name' == sf.name assert ('$abc', '$d') == sf.arguments @@ -1164,14 +1149,14 @@ class SassTypesTest(unittest.TestCase): def test_number_no_conversion(self): - num = sass.SassNumber(123., u'px') + num = sass.SassNumber(123., 'px') assert type(num.value) is float, type(num.value) - assert type(num.unit) is text_type, type(num.unit) + assert type(num.unit) is str, type(num.unit) def test_number_conversion(self): num = sass.SassNumber(123, b'px') assert type(num.value) is float, type(num.value) - assert type(num.unit) is text_type, type(num.unit) + assert type(num.unit) is str, type(num.unit) def test_color_no_conversion(self): color = sass.SassColor(1., 2., 3., .5) @@ -1198,20 +1183,20 @@ assert lst.separator is sass.SASS_SEPARATOR_SPACE, lst.separator def test_sass_warning_no_conversion(self): - warn = sass.SassWarning(u'error msg') - assert type(warn.msg) is text_type, type(warn.msg) + warn = sass.SassWarning('error msg') + assert type(warn.msg) is str, type(warn.msg) def test_sass_warning_no_conversion_bytes_message(self): warn = sass.SassWarning(b'error msg') - assert type(warn.msg) is text_type, type(warn.msg) + assert type(warn.msg) is str, type(warn.msg) def test_sass_error_no_conversion(self): - err = sass.SassError(u'error msg') - assert type(err.msg) is text_type, type(err.msg) + err = sass.SassError('error msg') + assert type(err.msg) is str, type(err.msg) def test_sass_error_conversion(self): err = sass.SassError(b'error msg') - assert type(err.msg) is text_type, type(err.msg) + assert type(err.msg) is str, type(err.msg) def raises(): @@ -1244,11 +1229,11 @@ def returns_unicode(): - return u'â' + return 'â' def returns_bytes(): - return u'â'.encode('UTF-8') + return 'â'.encode() def returns_number(): @@ -1380,7 +1365,7 @@ assert msg == expected, (msg, expected) -class RegexMatcher(object): +class RegexMatcher: def __init__(self, reg, flags=None): self.reg = re.compile(reg, re.MULTILINE | re.DOTALL) @@ -1393,14 +1378,14 @@ def test_raises(self): with assert_raises_compile_error( RegexMatcher( - r'^Error: error in C function raises: \n' - r' Traceback \(most recent call last\):\n' - r'.+' - r'AssertionError: foo\n' - r' on line 1:14 of stdin, in function `raises`\n' - r' from line 1:14 of stdin\n' - r'>> a { content: raises\(\); }\n' - r' -------------\^\n$', + r'^Error: error in C function raises: \n' + r' Traceback \(most recent call last\):\n' + r'.+' + r'AssertionError: foo\n' + r' on line 1:14 of stdin, in function `raises`\n' + r' from line 1:14 of stdin\n' + r'>> a { content: raises\(\); }\n' + r' -------------\^\n$', ), ): compile_with_func('a { content: raises(); }') @@ -1472,13 +1457,13 @@ def test_unicode(self): self.assertEqual( compile_with_func('a { content: returns_unicode(); }'), - u'\ufeffa{content:â}\n', + '\ufeffa{content:â}\n', ) def test_bytes(self): self.assertEqual( compile_with_func('a { content: returns_bytes(); }'), - u'\ufeffa{content:â}\n', + '\ufeffa{content:â}\n', ) def test_number(self): @@ -1550,7 +1535,7 @@ def test_identity_strings(self): self.assertEqual( compile_with_func('a { content: identity(returns_unicode()); }'), - u'\ufeffa{content:â}\n', + '\ufeffa{content:â}\n', ) def test_identity_number(self): @@ -1626,7 +1611,7 @@ def test_stack_trace_formatting(): try: - sass.compile(string=u'a{â') + sass.compile(string='a{â') raise AssertionError('expected to raise CompileError') except sass.CompileError: tb = traceback.format_exc() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsass-python-0.21.0/sassutils/_compat.py new/libsass-python-0.22.0/sassutils/_compat.py --- old/libsass-python-0.21.0/sassutils/_compat.py 2021-05-21 03:41:54.000000000 +0200 +++ new/libsass-python-0.22.0/sassutils/_compat.py 1970-01-01 01:00:00.000000000 +0100 @@ -1,7 +0,0 @@ -from six import PY2 - - -if PY2: # pragma: no cover (PY2) - import collections as collections_abc # noqa: F401 -else: # pragma: no cover (PY3) - import collections.abc as collections_abc # noqa: F401 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsass-python-0.21.0/sassutils/builder.py new/libsass-python-0.22.0/sassutils/builder.py --- old/libsass-python-0.21.0/sassutils/builder.py 2021-05-21 03:41:54.000000000 +0200 +++ new/libsass-python-0.22.0/sassutils/builder.py 2022-11-12 18:43:54.000000000 +0100 @@ -2,17 +2,12 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ """ - -import io -import os +import collections.abc import os.path import re import warnings -from six import string_types - from sass import compile -from sassutils._compat import collections_abc __all__ = 'SUFFIXES', 'SUFFIX_PATTERN', 'Manifest', 'build_directory' @@ -69,7 +64,7 @@ output_style=output_style, include_paths=[_root_sass], ) - with io.open( + with open( css_fullname, 'w', encoding='utf-8', newline='', ) as css_file: css_file.write(css) @@ -88,7 +83,7 @@ return result -class Manifest(object): +class Manifest: """Building manifest of Sass/SCSS. :param sass_path: the path of the directory that contains Sass/SCSS @@ -105,7 +100,7 @@ def normalize_manifests(cls, manifests): if manifests is None: manifests = {} - elif isinstance(manifests, collections_abc.Mapping): + elif isinstance(manifests, collections.abc.Mapping): manifests = dict(manifests) else: raise TypeError( @@ -113,7 +108,7 @@ repr(manifests), ) for package_name, manifest in manifests.items(): - if not isinstance(package_name, string_types): + if not isinstance(package_name, str): raise TypeError( 'manifest keys must be a string of package ' 'name, not ' + repr(package_name), @@ -122,9 +117,9 @@ continue elif isinstance(manifest, tuple): manifest = Manifest(*manifest) - elif isinstance(manifest, collections_abc.Mapping): + elif isinstance(manifest, collections.abc.Mapping): manifest = Manifest(**manifest) - elif isinstance(manifest, string_types): + elif isinstance(manifest, str): manifest = Manifest(manifest) else: raise TypeError( @@ -142,21 +137,21 @@ wsgi_path=None, strip_extension=None, ): - if not isinstance(sass_path, string_types): + if not isinstance(sass_path, str): raise TypeError( 'sass_path must be a string, not ' + repr(sass_path), ) if css_path is None: css_path = sass_path - elif not isinstance(css_path, string_types): + elif not isinstance(css_path, str): raise TypeError( 'css_path must be a string, not ' + repr(css_path), ) if wsgi_path is None: wsgi_path = css_path - elif not isinstance(wsgi_path, string_types): + elif not isinstance(wsgi_path, str): raise TypeError( 'wsgi_path must be a string, not ' + repr(wsgi_path), @@ -292,11 +287,11 @@ css_folder = os.path.dirname(css_path) if not os.path.exists(css_folder): os.makedirs(css_folder) - with io.open(css_path, 'w', encoding='utf-8', newline='') as f: + with open(css_path, 'w', encoding='utf-8', newline='') as f: f.write(css) if source_map: # Source maps are JSON, and JSON has to be UTF-8 encoded - with io.open( + with open( source_map_path, 'w', encoding='utf-8', newline='', ) as f: f.write(source_map) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsass-python-0.21.0/sassutils/distutils.py new/libsass-python-0.22.0/sassutils/distutils.py --- old/libsass-python-0.21.0/sassutils/distutils.py 2021-05-21 03:41:54.000000000 +0200 +++ new/libsass-python-0.22.0/sassutils/distutils.py 2022-11-12 18:43:54.000000000 +0100 @@ -67,19 +67,17 @@ Added ``--output-style``/``-s`` option to :class:`build_sass` command. """ -from __future__ import absolute_import +import functools +import os.path import distutils.errors import distutils.log import distutils.util -import functools -import os.path - from setuptools import Command from setuptools.command.sdist import sdist -from sass import OUTPUT_STYLES from .builder import Manifest +from sass import OUTPUT_STYLES __all__ = 'build_sass', 'validate_manifests' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsass-python-0.21.0/sassutils/wsgi.py new/libsass-python-0.22.0/sassutils/wsgi.py --- old/libsass-python-0.21.0/sassutils/wsgi.py 2021-05-21 03:41:54.000000000 +0200 +++ new/libsass-python-0.22.0/sassutils/wsgi.py 2022-11-12 18:43:54.000000000 +0100 @@ -2,22 +2,19 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ """ -from __future__ import absolute_import - +import collections.abc import logging -import os import os.path from pkg_resources import resource_filename -from sass import CompileError -from sassutils._compat import collections_abc from .builder import Manifest +from sass import CompileError __all__ = 'SassMiddleware', -class SassMiddleware(object): +class SassMiddleware: r"""WSGI middleware for development purpose. Every time a CSS file has requested it finds a matched Sass/SCSS source file and then compiled it into CSS. @@ -100,7 +97,7 @@ ) self.app = app self.manifests = Manifest.normalize_manifests(manifests) - if not isinstance(package_dir, collections_abc.Mapping): + if not isinstance(package_dir, collections.abc.Mapping): raise TypeError( 'package_dir must be a mapping object, not ' + repr(package_dir), @@ -138,7 +135,7 @@ sass_filename, source_map=True, ) - except (IOError, OSError): + except OSError: break except CompileError as e: logger = logging.getLogger(__name__ + '.SassMiddleware') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsass-python-0.21.0/setup.py new/libsass-python-0.22.0/setup.py --- old/libsass-python-0.21.0/setup.py 2021-05-21 03:41:54.000000000 +0200 +++ new/libsass-python-0.22.0/setup.py 2022-11-12 18:43:54.000000000 +0100 @@ -1,10 +1,5 @@ -from __future__ import print_function - import ast import atexit -import distutils.cmd -import distutils.log -import distutils.sysconfig import os.path import platform import shutil @@ -12,7 +7,11 @@ import sys import tempfile -from setuptools import Extension, setup +import distutils.cmd +import distutils.log +import distutils.sysconfig +from setuptools import Extension +from setuptools import setup MACOS_FLAG = ['-mmacosx-version-min=10.7'] FLAGS_POSIX = [ @@ -82,9 +81,9 @@ libsass_version = libsass_version_file.read().decode('UTF-8').strip() if sys.platform == 'win32': # This looks wrong, but is required for some reason :( - define = r'/DLIBSASS_VERSION="\"{}\""'.format(libsass_version) + define = fr'/DLIBSASS_VERSION="\"{libsass_version}\""' else: - define = '-DLIBSASS_VERSION="{}"'.format(libsass_version) + define = f'-DLIBSASS_VERSION="{libsass_version}"' for directory in ( os.path.join('libsass', 'src'), @@ -184,7 +183,7 @@ try: with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as f: return f.read() - except IOError: + except OSError: pass @@ -231,7 +230,7 @@ else: class bdist_wheel(wheel.bdist_wheel.bdist_wheel): def finalize_options(self): - self.py_limited_api = 'cp3{}'.format(sys.version_info[1]) + self.py_limited_api = f'cp3{sys.version_info[1]}' super().finalize_options() cmdclass['bdist_wheel'] = bdist_wheel @@ -245,7 +244,7 @@ version=version(), ext_modules=[sass_extension], packages=['sassutils'], - py_modules=['pysassc', 'sass', 'sassc', 'sasstests'], + py_modules=['pysassc', 'sass', 'sasstests'], package_data={ '': [ 'README.rst', @@ -266,11 +265,8 @@ ], 'console_scripts': [ ['pysassc = pysassc:main'], - # TODO: remove `sassc` entry (#134) - ['sassc = sassc:main'], ], }, - install_requires=['six'], classifiers=[ 'Development Status :: 5 - Production/Stable', 'Environment :: Web Environment', @@ -279,7 +275,6 @@ 'Operating System :: OS Independent', 'Programming Language :: C', 'Programming Language :: C++', - 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', @@ -293,5 +288,6 @@ 'Topic :: Software Development :: Code Generators', 'Topic :: Software Development :: Compilers', ], + python_requires='>=3.6', cmdclass=cmdclass, ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsass-python-0.21.0/tox.ini new/libsass-python-0.22.0/tox.ini --- old/libsass-python-0.21.0/tox.ini 2021-05-21 03:41:54.000000000 +0200 +++ new/libsass-python-0.22.0/tox.ini 2022-11-12 18:43:54.000000000 +0100 @@ -1,5 +1,5 @@ [tox] -envlist = pypy,pypy3,py27,py36,py37,py38,py39,pre-commit +envlist = pypy3,py36,py37,py38,py39,pre-commit [testenv] usedevelop = true