From 2f17e21b0bd8d8d394e6d3c52e93e4461ea2fa8b Mon Sep 17 00:00:00 2001 From: Johannes Hoppe Date: Mon, 8 Apr 2019 18:55:31 +0200 Subject: [PATCH] Simplify package setup --- .editorconfig | 20 ++++ .checks.yml => .fussyfox.yml | 5 +- .travis.yml | 118 +++++++++---------- CHANGELOG.md | 218 ----------------------------------- LICENSE | 28 +++-- docs/conf.py | 16 +-- requirements-dev.txt | 11 -- requirements.txt | 1 - setup.cfg | 84 ++++++++++---- setup.py | 5 +- tests/testapp/settings.py | 17 --- tox.ini | 23 ---- 12 files changed, 159 insertions(+), 387 deletions(-) create mode 100644 .editorconfig rename .checks.yml => .fussyfox.yml (79%) delete mode 100644 CHANGELOG.md delete mode 100644 requirements-dev.txt delete mode 100644 requirements.txt delete mode 100644 tox.ini diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..30b79a0 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,20 @@ +# http://editorconfig.org + +root = true + +[*] +indent_style = space +indent_size = 4 +trim_trailing_whitespace = true +insert_final_newline = true +charset = utf-8 +end_of_line = lf + +[*.{json,yml,yaml,js,jsx}] +indent_size = 2 + +[LICENSE] +insert_final_newline = false + +[Makefile] +indent_style = tab diff --git a/.checks.yml b/.fussyfox.yml similarity index 79% rename from .checks.yml rename to .fussyfox.yml index 98644b5..600df19 100644 --- a/.checks.yml +++ b/.fussyfox.yml @@ -1,3 +1,4 @@ -- flake8 -- pydocstyle - bandit +- flake8 +- isort +- pydocstyle diff --git a/.travis.yml b/.travis.yml index a84c54a..f4c329d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,82 +1,78 @@ -sudo: true +language: python dist: xenial -services: redis-server -addons: - apt: - packages: - - chromium-chromedriver - -language: python python: - - 3.6 - - 3.7 -cache: pip + - "3.6" + - "3.7" env: - matrix: - - DJANGO=20 - - DJANGO=21 - - DJANGO=22 - - DJANGO=master + - DJANGO=20 + - DJANGO=21 + - DJANGO=22 + - DJANGO=master + matrix: fast_finish: true allow_failures: - env: DJANGO=master +addons: + apt: + packages: + - chromium-chromedriver + +install: pip install tox-travis codecov + +before_script: + - ln -s /usr/lib/chromium-browser/chromedriver ~/bin/chromedriver + - | + if [[ -z $TOXENV ]]; then + export TOXENV=py$(echo $TRAVIS_PYTHON_VERSION | sed -e 's/\.//g')-dj$DJANGO + fi + - echo $TOXENV + +script: tox + +after_success: codecov + jobs: include: - - stage: docs + - python: "3.5" + env: TOXENV=docs addons: apt: packages: - python3-enchant - python-enchant - graphviz - python: "3.5" - script: tox -e docs - - stage: qa - addons: - language: node_js + - language: node_js + addons: {} install: npm install script: npm test node_js: lts/* cache: npm -states: - - qa - - docs - - test - - deploy -install: -- pip install --upgrade pip tox -- pip install -U codecov -before_script: -- ln -s /usr/lib/chromium-browser/chromedriver ~/bin/chromedriver -- | - if [[ -z $TOXENV ]]; then - export TOXENV=py$(echo $TRAVIS_PYTHON_VERSION | sed -e 's/\.//g')-dj$DJANGO - fi -- echo $TOXENV -script: -- tox -e $TOXENV -after_success: -- codecov -before_deploy: - - git stash --all - - ./set_version.py -_deploy_provider: &_deploy_provider - skip_cleanup: true - on: - tags: true - repo: applegrew/django-select2 -deploy: - - <<: *_deploy_provider - provider: pypi - distributions: sdist bdist_wheel - user: codingjoe - password: - secure: fEP9K7y0ZF9fRvQEUN4kgPXQEZvi3Cx3ikUebG2UM/2uhcaUQm0+KpgZ2S+lvOTYcBnNgzPzFsVIZMcVcTxwIKuQDEMq9y2eop2hnisb9KXsIm9qPYSzOnRm74VuiOt4hNOZMe0qVBK2cO3vC9NDXuzdI8A0JynJhthfl4t+kFM= - - <<: *_deploy_provider - provider: npm - email: info@johanneshoppe.com - api_key: - secure: PV38cQx9qhEFkpSdytbM72UzIMCfhpjmRJ8dzT+bCAaOIs5rEcyKN+h1r5ranunCxWyuFsMW4A2iW/SCxnKCR/oPAguuwUbT5ogBXlsskqPFWUxuoTHYMrd+zB+SC6+bMgq+o5ul+kJCYtEkWP6cMlIEzKyTLab7m5PsnDXNVnI= + - stage: deploy + if: tag IS present + python: 3.7 + install: skip + script: skip + after_success: skip + before_deploy: + - git stash --all + - ./set_version.py + _deploy_provider: &_deploy_provider + skip_cleanup: true + on: + tags: true + repo: applegrew/django-select2 + deploy: + - <<: *_deploy_provider + provider: pypi + distributions: sdist bdist_wheel + user: codingjoe + password: + secure: fEP9K7y0ZF9fRvQEUN4kgPXQEZvi3Cx3ikUebG2UM/2uhcaUQm0+KpgZ2S+lvOTYcBnNgzPzFsVIZMcVcTxwIKuQDEMq9y2eop2hnisb9KXsIm9qPYSzOnRm74VuiOt4hNOZMe0qVBK2cO3vC9NDXuzdI8A0JynJhthfl4t+kFM= + - <<: *_deploy_provider + provider: npm + email: info@johanneshoppe.com + api_key: + secure: PV38cQx9qhEFkpSdytbM72UzIMCfhpjmRJ8dzT+bCAaOIs5rEcyKN+h1r5ranunCxWyuFsMW4A2iW/SCxnKCR/oPAguuwUbT5ogBXlsskqPFWUxuoTHYMrd+zB+SC6+bMgq+o5ul+kJCYtEkWP6cMlIEzKyTLab7m5PsnDXNVnI= diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index bf9c924..0000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,218 +0,0 @@ -Changelog Summary -================= - -Changes for django-select2 v6.0.1 and later are logged on the [github releases page](https://github.com/applegrew/django-select2/releases). - -### v6.0.0 - -* Add Support for Django 2.0 -* Drop Python 2 support -* Drop Python 3.5 support -* Drop Django 1.8 support -* Drop Django 1.10 support - -### v5.10.0 -* Add support for dependent select fields [321](github.com/applegrew/django-select2/pull/321/). - -### v5.9.0 -* Add support for Django 1.11 LTS -* Drop support for Django 1.9 - -### v5.8.10 -* Fixes tests for Django 1.10+ -* retain order of choices [299](https://github.com/applegrew/django-select2/pull/299) - -### v5.8.9 -* Fixes tests. No functional change from 5.8.8. - -### v5.8.8 -* Upgrade Select2 to version 4.0.3 - -### v5.8.7 -* Fix #285 -- Do not evaluate queryset in `render_options`. - -### v5.8.3 -* Remove six dependency -- User django.utils.six instead. - -### v5.8.2 -* Fixes #260 -- Fixes bug in render choices - -### v5.8.0 -* Changed signature of `render` and `render_choices` to satisfy Django 1.10 changes. -* Changed widgets' inheritance tree to be more consistent. - -### v5.7.1 -* Fixes pickle bug of lazy object - -### v5.7.0 -* Security fix that allows a `field_id` to only be used for the intended JSON endpoint. - - Prior to that change you could use any `field_id` on any select2 JSON endpoint. - Even if the id was intended to be used on a private endpoint if could be used on - the default one and therefore leak sensitive data. - -* Breaking change on how `Heavy` widgets are being cached. - - Heavy widgets used to add themselves to the cache. Now they add a dictionary to - the cache containing themselves and the target url. - - ```python - { - 'widget': self, - 'url': self.get_url(), - } - ``` - -### v5.6.0 -* Added `label_from_instance` method for model widgets to define custom option labels. - -### v5.5.0 -* Added settings to delivery static assets from different source. - -### v5.4.2 -* Fixed initial data not being shown for heavy widgets. - -### v5.4.1 -* Fixed memory leak in `ModelSelect2Mixin` and subclasses - -### v5.4.0 -* Added `Select2TagWidget` a light widget with tagging support - -### v5.3.0 -* Added djangoSelect2 jQuery plugin to support - dynamic field initialisation - -### v5.2.0 -* Added pagination - -### v5.1.0 -* Added search term splitting -* Model widgets get smarter pickling to reduce size and avoid pickling issues - -### v5.0.0 -Version 5 is a complete rewrite of the package to drastically reduce -the code base and to ensure a future maintainability. - -While we feature set remained unchanged, the API changed completely. -Major changes: -* Fields have been removed in favor of widgets. -* All version 4 settings have been removed. -* Template tags have been removed. -* 3rd party javascript is served by a CDN. -* No more inline javascript code. - -### v4.3.2 - -* Use `django.contrib.staticfiles.templatetags.staticfiles.static` over `django.templatetags.static.static` to allow hashing. -* Py23 unicode fixes - - -### v4.3.1 - -* Build failure fix. - -### v4.3.0 - -* Now the package supports both Python2 and Python3. -* Django 1.8 support added. -* Many bug fixes. - -### v4.2.2 - -* Misc fixes and enhancements - [61](https://github.com/applegrew/django-select2/pull/61), [64](https://github.com/applegrew/django-select2/issues/64). - -### v4.2.1 - -* Finally fixed performance issue[#54](https://github.com/applegrew/django-select2/issues/54) (and issue[#41](https://github.com/applegrew/django-select2/issues/41)) in widgets when backing field is based on models and the field has an initial value. - -### v4.2.0 - -* Updated Select2 to version 3.4.2. **Please note**, that if you need any of the Select2 locale files, then you need to download them yourself from http://ivaynberg.github.com/select2/ and add to your project. -* Tagging support added. See [Field API reference](http://django-select2.readthedocs.org/en/latest/ref_fields.html) in documentation. - -### v4.1.0 - -* Updated Select2 to version 3.4.1. **Please note**, that if you need any of the Select2 locale files, then you need to download them yourself from http://ivaynberg.github.com/select2/ and add to your project. -* Address isssue[#36](https://github.com/applegrew/django-select2/issues/36) - Fix importerror under django1.6. -* Fixed the way `setup.py` handles Unicode files while minifying them during package build. -* Address isssue[#39](https://github.com/applegrew/django-select2/issues/39) - MultipleSelect2HiddenInput.render() should use mark_safe(). -* Address isssue[#45](https://github.com/applegrew/django-select2/issues/45) - MultipleSelect2HiddenInput returns bad has_changed value. - -### v4.0.0 - -* Main version number bumped to bring your attention to the fact that the default Id generation scheme has now changed. Now Django Select2 will use hashed paths of fields to generate their Ids. The old scheme of generating random Ids are still there. You can enable that by setting `GENERATE_RANDOM_SELECT2_ID` to `True`. - -### v3.3.1 - -* Addressed issue[#30](https://github.com/applegrew/django-select2/issues/30). -* Merged pull request[#31](https://github.com/applegrew/django-select2/issues/31). -* Added `light` parameter to `import_django_select2_js`, `import_django_select2_css` and `import_django_select2_js_css` template tags. Please see doc's "Getting Started", for more details. - -### v3.3.0 - -* Updated Select2 to version 3.3.1. -* Added multi-process support. ([Issue#28](https://github.com/applegrew/django-select2/issues/28)). -* Addressed issue[#26](https://github.com/applegrew/django-select2/issues/26). -* Addressed issue[#24](https://github.com/applegrew/django-select2/issues/24). -* Addressed issue[#23](https://github.com/applegrew/django-select2/issues/23). -* Addressed some typos. - -### v3.2.0 - -* Fixed issue[#20](https://github.com/applegrew/django-select2/issues/20). Infact while fixing that I realised that heavy components do not need the help of cookies, infact due to a logic error in previous code the cookies were not being used anyway. Now Django Select2 does not use cookies etc. -* Few more bugs fixed in `heav_data.js`. -* Now production code will use minimized versions of js and css files. -* Codes added in `setup.py` to automate the task of minimizing js and css files, using a web service. - -### v3.1.5 - -* Merged pull request (issue[#17](https://github.com/applegrew/django-select2/issues/17)). Which allows the user to pass some extra data to Select2 clients-side component. -* Updated License. The previous one was inadequently worded. Now this project use Apache 2.0 license. - -### v3.1.4 - -* Manually merged changes from pull request (issue[#16](https://github.com/applegrew/django-select2/issues/16)). -* Django Select2 widgets now allow passing of any Select2 Js options. Previously it used to allow only white-listed options. Now it will block only black-listed options. For example, Light Select2 widgets won't allow you to set `multiple` option, since it is an error to set them when Select2 Js is bound to `