Release cssbeautifier along with the rest

This commit is contained in:
Jorengarenar 2020-01-17 21:32:53 +01:00
parent 3d92a62fbe
commit 0a09c4b275
3 changed files with 10 additions and 14 deletions

1
python/__init__.py Normal file
View File

@ -0,0 +1 @@
# Empty file :)

View File

@ -3,29 +3,23 @@
import os
import sys
from setup import PyTest # from setyp.py, not setuptools!
from setuptools import setup
from jsbeautifier.__version__ import __version__
from setuptools.command.test import test as TestCommand
DIR = 'cssbeautifier/tests/'
DIR_CSS = 'cssbeautifier/tests/'
class PyTest(TestCommand):
user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")]
class PyTestCSS(PyTest):
def initialize_options(self):
TestCommand.initialize_options(self)
self.pytest_args = ['--assert=plain'] + \
[DIR + x for x in os.listdir(DIR)
[DIR_CSS + x for x in os.listdir(DIR_CSS)
if x.endswith('.py') and x[0] not in '._']
def run_tests(self):
# import here, cause outside the eggs aren't loaded
import pytest
errno = pytest.main(self.pytest_args)
sys.exit(errno)
setup(name='cssbeautifier',
version=__version__,
@ -47,6 +41,6 @@ setup(name='cssbeautifier',
"editorconfig>=0.12.2"],
license='MIT',
test_suite='pytest.collector',
cmdclass={'test': PyTest},
cmdclass={'test': PyTestCSS},
)

View File

@ -18,6 +18,7 @@ release_python()
cd python
# python setup.py register -r pypi
python setup.py sdist || exit 1
python setup-css.py sdist || exit 1
python -m twine upload dist/* || exit 1
}
@ -96,7 +97,7 @@ main()
NEW_VERSION=$1
git checkout master || exit 1
npm --version > /dev/null || {
echo ERROR: npm must be installed before attempting release
exit 1
@ -106,7 +107,7 @@ main()
echo ERROR: twine must be installed before attempting release
exit 1
}
update_versions
update_release_branch