Skip to content

use setup-cfg-fmt to format package metadata #453

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 = [email protected]
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,
)