Skip to content

Commit

Permalink
Merge pull request #453 from sass/setup-cfg-fmt
Browse files Browse the repository at this point in the history
use setup-cfg-fmt to format package metadata
  • Loading branch information
asottile authored Jan 6, 2024
2 parents a5cb682 + 73d9fe0 commit b8e0160
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 70 deletions.
6 changes: 5 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ repos:
- id: double-quote-string-fixer
- id: name-tests-test
- id: requirements-txt-fixer
- repo: https://github.com/asottile/setup-cfg-fmt
rev: v2.5.0
hooks:
- id: setup-cfg-fmt
- repo: https://github.com/asottile/reorder-python-imports
rev: v3.12.0
hooks:
Expand All @@ -28,7 +32,7 @@ repos:
hooks:
- id: autopep8
- repo: https://github.com/PyCQA/flake8
rev: 6.1.0
rev: 7.0.0
hooks:
- id: flake8
exclude: ^docs/conf.py
48 changes: 45 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,9 +1,51 @@
[metadata]
name = libsass
version = attr: sass.__version__
description = Sass for Python: A straightforward binding of libsass for Python.
long_description = file: README.rst
long_description_content_type = text/x-rst
url = https://sass.github.io/libsass-python/
author = Hong Minhee
author_email = minhee@dahlia.kr
license = MIT
license_files = LICENSE
classifiers =
Development Status :: 5 - Production/Stable
Environment :: Web Environment
Intended Audience :: Developers
License :: OSI Approved :: MIT License
Operating System :: OS Independent
Programming Language :: C
Programming Language :: C++
Programming Language :: Python :: 3
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: Implementation :: CPython
Programming Language :: Python :: Implementation :: PyPy
Programming Language :: Python :: Implementation :: Stackless
Topic :: Internet :: WWW/HTTP
Topic :: Internet :: WWW/HTTP :: Dynamic Content
Topic :: Software Development :: Code Generators
Topic :: Software Development :: Compilers

[options]
packages = sassutils
py_modules =
pysassc
sass
sasstests
python_requires = >=3.8

[options.entry_points]
console_scripts =
pysassc = pysassc:main
distutils.commands =
build_sass = sassutils.distutils:build_sass
distutils.setup_keywords =
sass_manifests = sassutils.distutils:validate_manifests

[aliases]
upload_doc = build_sphinx upload_doc
release = sdist upload build_sphinx upload_doc

[flake8]
exclude = .tox,build,dist,docs,ez_setup.py

[metadata]
license_file = LICENSE
66 changes: 0 additions & 66 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import ast
import atexit
import os.path
import platform
Expand Down Expand Up @@ -169,24 +168,6 @@ def restore_cencode():
)


def version(sass_filename='sass.py'):
with open(sass_filename) as f:
tree = ast.parse(f.read(), sass_filename)
for node in tree.body:
if isinstance(node, ast.Assign) and len(node.targets) == 1:
target, = node.targets
if isinstance(target, ast.Name) and target.id == '__version__':
return node.value.s


def readme():
try:
with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as f:
return f.read()
except OSError:
pass


class upload_doc(distutils.cmd.Command):
"""Uploads the documentation to GitHub pages."""

Expand Down Expand Up @@ -237,53 +218,6 @@ def finalize_options(self):


setup(
name='libsass',
description='Sass for Python: '
'A straightforward binding of libsass for Python.',
long_description=readme(),
version=version(),
ext_modules=[sass_extension],
packages=['sassutils'],
py_modules=['pysassc', 'sass', 'sasstests'],
package_data={
'': [
'README.rst',
'test/*.sass',
],
},
license='MIT License',
author='Hong Minhee',
author_email='minhee' '@' 'dahlia.kr',
url='https://sass.github.io/libsass-python/',
download_url='https://github.com/sass/libsass-python/releases',
entry_points={
'distutils.commands': [
'build_sass = sassutils.distutils:build_sass',
],
'distutils.setup_keywords': [
'sass_manifests = sassutils.distutils:validate_manifests',
],
'console_scripts': [
['pysassc = pysassc:main'],
],
},
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Web Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: C',
'Programming Language :: C++',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Programming Language :: Python :: Implementation :: Stackless',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
'Topic :: Software Development :: Code Generators',
'Topic :: Software Development :: Compilers',
],
python_requires='>=3.8',
cmdclass=cmdclass,
)

0 comments on commit b8e0160

Please sign in to comment.