Skip to content

Commit 73d725f

Browse files
authored
Merge pull request #373 from sass/drop-py2
drop python 2.x
2 parents 80b0fff + d333e3c commit 73d725f

15 files changed

+129
-171
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ repos:
1515
rev: v2.29.0
1616
hooks:
1717
- id: pyupgrade
18+
args: [--py36-plus]
1819
- repo: https://github.com/asottile/add-trailing-comma
1920
rev: v2.2.0
2021
hooks:
2122
- id: add-trailing-comma
23+
args: [--py36-plus]

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ distribution/deployment. That means you can add just ``libsass`` into
2424
your ``setup.py``'s ``install_requires`` list or ``requirements.txt`` file.
2525
No need for Ruby nor Node.js.
2626

27-
It currently supports CPython 2.7, 3.6--3.8, and PyPy 2.3+!
27+
It currently supports CPython 3.6+, and PyPy 3!
2828

2929
.. _Sass: https://sass-lang.com/
3030
.. _LibSass: https://github.com/sass/libsass

azure-pipelines.yml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,9 @@ resources:
1818
jobs:
1919
- template: job--python-tox.yml@asottile
2020
parameters:
21-
toxenvs: [py27, py36]
21+
toxenvs: [py36]
2222
os: macos
2323
wheel_tags: true
24-
- template: job--python-tox.yml@asottile
25-
parameters:
26-
toxenvs: [py27]
27-
os: windows
28-
architectures: [x64, x86]
29-
name_postfix: _py27
30-
wheel_tags: true
31-
pre_test:
32-
- script: rm -rf libsass/test
3324
- template: job--python-tox.yml@asottile
3425
parameters:
3526
toxenvs: [py36]
@@ -38,5 +29,5 @@ jobs:
3829
wheel_tags: true
3930
- template: job--python-tox.yml@asottile
4031
parameters:
41-
toxenvs: [pypy, pypy3, py27, py36, py37, py38, py39]
32+
toxenvs: [pypy3, py36, py37, py38, py39]
4233
os: linux

bin/build-manylinux-wheels

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ def main():
2323
os.makedirs('dist', exist_ok=True)
2424
for python in ('cp27-cp27mu', 'cp36-cp36m'):
2525
with tempfile.TemporaryDirectory() as work:
26-
pip = '/opt/python/{}/bin/pip'.format(python)
26+
pip = f'/opt/python/{python}/bin/pip'
2727
check_call(
2828
'docker', 'run', '-ti',
2929
# Use this so the files are not owned by root
30-
'--user', '{}:{}'.format(os.getuid(), os.getgid()),
30+
'--user', f'{os.getuid()}:{os.getgid()}',
3131
# We'll do building in /work and copy results to /dist
32-
'-v', '{}:/work:rw'.format(work),
32+
'-v', f'{work}:/work:rw',
3333
'-v', '{}:/dist:rw'.format(os.path.abspath('dist')),
3434
'quay.io/pypa/manylinux1_x86_64:latest',
3535
'bash', '-exc',

docs/conf.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
#
32
# libsass documentation build configuration file, created by
43
# sphinx-quickstart on Sun Aug 19 22:45:57 2012.
@@ -48,8 +47,8 @@
4847
master_doc = 'index'
4948

5049
# General information about the project.
51-
project = u'libsass'
52-
copyright = u'2012, Hong Minhee'
50+
project = 'libsass'
51+
copyright = '2012, Hong Minhee'
5352

5453
# The version info for the project you're documenting, acts as replacement for
5554
# |version| and |release|, also used in various other places throughout the
@@ -194,8 +193,8 @@
194193
# (source start file, target name, title, author, documentclass [howto/manual]).
195194
latex_documents = [
196195
(
197-
'index', 'libsass.tex', u'libsass Documentation',
198-
u'Hong Minhee', 'manual',
196+
'index', 'libsass.tex', 'libsass Documentation',
197+
'Hong Minhee', 'manual',
199198
),
200199
]
201200

@@ -226,8 +225,8 @@
226225
# (source start file, name, description, authors, manual section).
227226
man_pages = [
228227
(
229-
'index', 'libsass', u'libsass Documentation',
230-
[u'Hong Minhee'], 1,
228+
'index', 'libsass', 'libsass Documentation',
229+
['Hong Minhee'], 1,
231230
),
232231
]
233232

@@ -242,8 +241,8 @@
242241
# dir menu entry, description, category)
243242
texinfo_documents = [
244243
(
245-
'index', 'libsass', u'libsass Documentation',
246-
u'Hong Minhee', 'libsass', 'One line description of project.',
244+
'index', 'libsass', 'libsass Documentation',
245+
'Hong Minhee', 'libsass', 'One line description of project.',
247246
'Miscellaneous',
248247
),
249248
]

docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ distribution/deployment. That means you can add just ``libsass`` into
88
your :file:`setup.py`'s ``install_requires`` list or :file:`requirements.txt`
99
file.
1010

11-
It currently supports CPython 2.6, 2.7, 3.5--3.7, and PyPy 2.3+!
11+
It currently supports CPython 3.6+ and PyPy 3!
1212

1313
.. _Sass: https://sass-lang.com/
1414
.. _LibSass: https://github.com/sass/libsass

pysassc.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,8 @@
8888
.. _SassC: https://github.com/sass/sassc
8989
9090
"""
91-
from __future__ import print_function
9291

9392
import functools
94-
import io
9593
import optparse
9694
import sys
9795
import warnings
@@ -219,7 +217,7 @@ def main(argv=sys.argv, stdout=sys.stdout, stderr=sys.stderr):
219217
include_paths=options.include_paths,
220218
precision=options.precision,
221219
)
222-
except (IOError, OSError) as e:
220+
except OSError as e:
223221
error(e)
224222
return 3
225223
except sass.CompileError as e:
@@ -229,10 +227,10 @@ def main(argv=sys.argv, stdout=sys.stdout, stderr=sys.stderr):
229227
if len(args) < 2:
230228
print(css, file=stdout)
231229
else:
232-
with io.open(args[1], 'w', encoding='utf-8', newline='') as f:
230+
with open(args[1], 'w', encoding='utf-8', newline='') as f:
233231
f.write(css)
234232
if source_map_filename:
235-
with io.open(
233+
with open(
236234
source_map_filename, 'w', encoding='utf-8', newline='',
237235
) as f:
238236
f.write(source_map)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy