Skip to content

Commit

Permalink
drop python 2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
asottile committed Nov 19, 2021
1 parent 80b0fff commit d333e3c
Show file tree
Hide file tree
Showing 15 changed files with 129 additions and 171 deletions.
2 changes: 2 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ repos:
rev: v2.29.0
hooks:
- id: pyupgrade
args: [--py36-plus]
- repo: https://github.com/asottile/add-trailing-comma
rev: v2.2.0
hooks:
- id: add-trailing-comma
args: [--py36-plus]
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ distribution/deployment. That means you can add just ``libsass`` into
your ``setup.py``'s ``install_requires`` list or ``requirements.txt`` file.
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
Expand Down
13 changes: 2 additions & 11 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,9 @@ resources:
jobs:
- template: job--python-tox.yml@asottile
parameters:
toxenvs: [py27, py36]
toxenvs: [py36]
os: macos
wheel_tags: true
- template: job--python-tox.yml@asottile
parameters:
toxenvs: [py27]
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]
Expand All @@ -38,5 +29,5 @@ jobs:
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
6 changes: 3 additions & 3 deletions bin/build-manylinux-wheels
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ def main():
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',
Expand Down
17 changes: 8 additions & 9 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
#
# libsass documentation build configuration file, created by
# sphinx-quickstart on Sun Aug 19 22:45:57 2012.
Expand Down Expand Up @@ -48,8 +47,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
Expand Down Expand Up @@ -194,8 +193,8 @@
# (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',
),
]

Expand Down Expand Up @@ -226,8 +225,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,
),
]

Expand All @@ -242,8 +241,8 @@
# dir menu entry, description, category)
texinfo_documents = [
(
'index', 'libsass', u'libsass Documentation',
u'Hong Minhee', 'libsass', 'One line description of project.',
'index', 'libsass', 'libsass Documentation',
'Hong Minhee', 'libsass', 'One line description of project.',
'Miscellaneous',
),
]
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ distribution/deployment. That means you can add just ``libsass`` into
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
Expand Down
8 changes: 3 additions & 5 deletions pysassc.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,8 @@
.. _SassC: https://github.com/sass/sassc
"""
from __future__ import print_function

import functools
import io
import optparse
import sys
import warnings
Expand Down Expand Up @@ -219,7 +217,7 @@ def main(argv=sys.argv, stdout=sys.stdout, stderr=sys.stderr):
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:
Expand All @@ -229,10 +227,10 @@ def main(argv=sys.argv, stdout=sys.stdout, stderr=sys.stderr):
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)
Expand Down
Loading

0 comments on commit d333e3c

Please sign in to comment.