Skip to content

Commit

Permalink
squashed changes from release-3-x
Browse files Browse the repository at this point in the history
updated changelog for 3.0 release

fixed local tox tests (runtests.sh)
  • Loading branch information
matthewhegarty committed Oct 17, 2022
1 parent cccf788 commit 63c1bef
Show file tree
Hide file tree
Showing 56 changed files with 2,835 additions and 604 deletions.
116 changes: 44 additions & 72 deletions .github/workflows/django-import-export-ci.yml
Expand Up @@ -7,112 +7,84 @@ on:
pull_request:
branches:
- main
# this is a temporary addition - can be removed after 3.0 release
- release-3-x

jobs:
test:
runs-on: ubuntu-latest
env:
USERNAME: testuser
PASSWD: ${{ secrets.TEST_PASSWD }}
DB_NAME: import_export
IMPORT_EXPORT_POSTGRESQL_USER: postgres
IMPORT_EXPORT_POSTGRESQL_PASSWORD: somepass
IMPORT_EXPORT_MYSQL_USER: root
IMPORT_EXPORT_MYSQL_PASSWORD: root
COVERAGE: 1
strategy:
max-parallel: 4
fail-fast: true
matrix:
db: [ sqlite, postgres, mysql ]
python-version: [ 3.7, 3.8, 3.9, "3.10" ]
django-version: [ 3.2, 4.0, main ]
include:
- db: postgres
db_port: 5432
- db: mysql
db_port: 3306
exclude:
- django-version: main
python-version: 3.7
- django-version: 4.0
python-version: 3.7
- django-version: 3.2
python-version: "3.10"
python-version:
- '3.7'
- '3.8'
- '3.9'
- '3.10'
services:
mysql:
image: mysql:8.0
env:
IMPORT_EXPORT_TEST_TYPE: mysql-innodb
IMPORT_EXPORT_MYSQL_USER: ${{ env.TESTUSER }}
IMPORT_EXPORT_MYSQL_PASSWORD: ${{ env.PASSWD }}
MYSQL_USER: ${{ env.TESTUSER }}
MYSQL_PASSWORD: ${{ env.IMPORT_EXPORT_MYSQL_PASSWORD }}
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: import_export
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=3
postgres:
image: postgres
env:
IMPORT_EXPORT_TEST_TYPE: postgres
IMPORT_EXPORT_POSTGRESQL_USER: postgres
IMPORT_EXPORT_POSTGRESQL_PASSWORD: ${{ env.PASSWD }}
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: import_export
POSTGRES_USER: ${{ env.IMPORT_EXPORT_POSTGRESQL_USER }}
POSTGRES_PASSWORD: ${{ env.IMPORT_EXPORT_POSTGRESQL_PASSWORD }}
POSTGRES_DB: ${{ env.DB_NAME }}
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Set up MySQL
run: >
sudo /etc/init.d/mysql start
mysql -e 'CREATE DATABASE ${{ env.DB_NAME }};'
-u${{ env.IMPORT_EXPORT_MYSQL_USER }}
-p${{ env.IMPORT_EXPORT_MYSQL_PASSWORD }}
- name: Check out repository code
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Run isort checks
- name: isort
uses: jamescurtin/isort-action@master
- uses: actions/cache@v2
with:
sortPaths: "import_export tests"
configuration: "--check-only"
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements/*.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements/base.txt
pip install -r requirements/test.txt
- if: matrix.django-version != 'main'
name: Upgrade Django version (release)
run: |
python -m pip install "Django~=${{ matrix.django-version }}.0"
- if: matrix.django-version == 'main'
name: Upgrade Django version (main)
run: |
python -m pip install "https://github.com/django/django/archive/main.tar.gz"
- name: List versions
run: |
echo "Python ${{ matrix.python-version }} -> Django ${{ matrix.django-version }}"
python --version
echo "Django `django-admin --version`"
- name: Run Tests
python -m pip install --upgrade pip
pip install tox tox-py coverage coveralls
- name: Run tox targets for ${{ matrix.python-version }} (sqlite)
run: tox --py current
- name: Run tox targets for ${{ matrix.python-version }} (postgres)
run: tox --py current
env:
IMPORT_EXPORT_TEST_TYPE: postgres
- name: Run tox targets for ${{ matrix.python-version }} (mysql)
run: tox --py current
env:
DB: ${{ matrix.db }}
DB_HOST: 127.0.0.1
DB_PORT: ${{ matrix.db_port }}
DB_PASSWORD: ${{ env.PASSWD }}
run: >-
PYTHONPATH=".:tests:$PYTHONPATH" python
-W error::DeprecationWarning -W error::PendingDeprecationWarning
-m coverage run --omit='setup.py,./tests/*,./import_export/locale/*'
--source=. tests/manage.py test core --settings=
IMPORT_EXPORT_TEST_TYPE: mysql-innodb
- name: Combine test coverage
run: coverage combine
- name: Upload coverage data to coveralls.io
run: coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: ${{ matrix.db }}-${{ matrix.django-version }}-${{ matrix.python-version }}
COVERALLS_FLAG_NAME: ${{ matrix.python-version }}
COVERALLS_PARALLEL: true

coveralls:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -13,4 +13,7 @@ dist/
.coverage
*.sw[po]

# IDE support
.vscode

tests/database.db
5 changes: 5 additions & 0 deletions AUTHORS
Expand Up @@ -121,8 +121,13 @@ The following is a list of much appreciated contributors:
* striveforbest (Alex Zagoro)
* josx (José Luis Di Biase)
* Jan Rydzewski
* rpsands (Ryan P. Sands)
* 2ykwang (Yeongkwang Yang)
* KamilRizatdinov (Kamil Rizatdinov)
* Mark Walker
* shimakaze-git
* frgmt
* vanschelven (Klaas van Schelven)
* HaPyTeX (Willem Van Onsem)
* nikhaldi (Nik Haldimann)
* TheRealVizard (Eduardo Leyva)
1 change: 1 addition & 0 deletions Makefile
Expand Up @@ -33,6 +33,7 @@ messages: ## generate locale file translations

coverage: ## generates codecov report
coverage run --omit='setup.py,tests/*' --source=. tests/manage.py test core --settings=
coverage combine
coverage report

sdist: clean ## package
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Expand Up @@ -42,7 +42,7 @@ Features:

* export data respecting admin filters

.. image:: docs/_static/images/django-import-export-change.png
.. image:: https://raw.githubusercontent.com/django-import-export/django-import-export/main/docs/_static/images/django-import-export-change.png


* Documentation: https://django-import-export.readthedocs.io/en/stable/
Expand Down
50 changes: 50 additions & 0 deletions RELEASE.md
@@ -0,0 +1,50 @@
## Release process

#### Pre release

- Set up `.pypirc` file to reference both pypi and testpypi.

#### Release

- Ensure that all code has been committed and integration tests have run on Github.
- `make messages` is intended to be run now to keep the translation files up-to-date.
- Run this if there have been any translations updates for the release.
- This creates updates to all translation files so there is no need to commit these unless there have been any translation changes.

```bash
# checked out clean version
git clone git@github.com:django-import-export/django-import-export.git django-import-export-rel

cd django-import-export-rel

# checkout any feature branch at this point
# git checkout develop

python3 -m venv venv
source venv/bin/activate
pip install -U pip setuptools wheel

pip install -r requirements/deploy.txt

# zest.releaser pre-release
# (you can set the correct version in this step)
prerelease
```

#### Perform the release

For the first pass you may choose not to upload only to testpypi (not pypi) so that you can check the release. You can check the release by manually downloading the files from testPyPI and checking the contents.

Once the test file have been checked, run again to upload to PyPI.

```bash
release

# resets the version and pushes changes to origin
postrelease

# remove the rel copy - no longer required
deactivate
cd ..
rm -rf django-import-export-rel
```
82 changes: 79 additions & 3 deletions docs/changelog.rst
@@ -1,11 +1,87 @@
Changelog
=========

2.9.1 (unreleased)
------------------
3.0.0 (unreleased)
-----------------------

Breaking changes
################

This release makes some minor changes to the public API. If you have overridden any methods from the `resources` or `widgets` modules, you may need to update your implementation to accommodate these changes.

- Check value of `ManyToManyField` in `skip_row()` (#1271)
- This fixes an issue where ManyToMany fields are not checked correctly in `skip_row()`. This means that `skip_row()` now takes `row` as a mandatory arg. If you have overridden `skip_row()` in your own implementation, you will need to add `row` as an arg.

- Bug fix: validation errors were being ignored when `skip_unchanged` is set (#1378)
- If you have overridden `skip_row()` you can choose whether or not to skip rows if validation errors are present. The default behavior is to not to skip rows if there are validation errors during import.

- Use 'create' flag instead of instance.pk (#1362)
- `import_export.resources.save_instance()` now takes an additional mandatory argument: `is_create`. If you have overridden `save_instance()` in your own code, you will need to add this new argument.

- `widgets`: Unused `*args` params have been removed from method definitions. (#1413)
- If you have overridden `clean()` then you should update your method definition to reflect this change.
- `widgets.ForeignKeyWidget` / `widgets.ManyToManyWidget`: The unused `*args` param has been removed from `__init__()`. If you have overridden `ForeignKeyWidget` or `ManyToManyWidget` you may need to update your implementation to reflect this change.

- Admin interface: Modified handling of import errors (#1306)
- Exceptions raised during the import process are now presented as form errors, instead of being wrapped in a \<H1\> tag in the response. If you have any custom logic which uses the error written directly into the response, then this may need to be changed.

- ImportForm: improve compatibility with previous signature (#1434)
- Previous `ImportForm` implementation was based on Django's `forms.Form`, if you have any custom ImportForm you now need to inherit from `import_export.forms.ImportExportFormBase`.

- Allow custom `change_list_template` in admin views using mixins (#1483)
- If you are using admin mixins from this library in conjunction with code that overrides `change_list_template` (typically admin mixins from other libraries such as django-admin-sortable2 or reversion), object tools in the admin change list views may render differently now.

- `import.html`: Added blocks to import template (#1488)
- If you have made customizations to the import template then you may need to refactor these after the addition of block declarations.

Deprecations
############

This release adds some deprecations which will be removed in a future release.

- Add support for multiple resources in ModelAdmin. (#1223)
- The `*Mixin.resource_class` accepting single resource has been deprecated and the new `*Mixin.resource_classes` accepting subscriptable type (list, tuple, ...) has been added.
- Same applies to all of the `get_resource_class`, `get_import_resource_class` and `get_export_resource_class` methods.

- Deprecated `exceptions.py` (#1372)

- Refactored form-related methods on `ImportMixin` / `ExportMixin` (#1147)
- The following are deprecated: `get_import_form()`, `get_confirm_import_form()`, `get_form_kwargs()`, `get_export_form()`

Enhancements
############

- Default format selections set correctly for export action (#1389)
- Added option to store raw row values in each row's `RowResult` (#1393)
- Add natural key support to `ForeignKeyWidget` (#1371)
- Optimised default instantiation of `CharWidget` (#1414)
- Allow custom `change_list_template` in admin views using mixins (#1483)
- Added blocks to import template (#1488)
- improve compatibility with previous ImportForm signature (#1434)
- Refactored form-related methods on `ImportMixin` / `ExportMixin` (#1147)
- Include custom form media in templates (#1038)
- Remove unnecessary files generated when running tox locally (#1426)

Fixes
#####

- Fixed Makefile coverage: added `coverage combine`
- Fixed handling of LF character when using `CacheStorage` (#1417)
- bugfix: `skip_row()` handles M2M field when UUID pk used
- Fix broken link to tablib formats page (#1418)
- Fix broken image ref in `README.rst`
- bugfix: `skip_row()` fix crash when model has m2m field and none is provided in upload (#1439)
- Fix deprecation in example application: Added support for transitional form renderer (#1451)

Development
###########

- Increased test coverage, refactored CI build to use tox (#1372)

- Nothing changed yet.
Documentation
#############

- Clarified issues around the usage of temporary storage (#1306)

2.9.0 (2022-09-14)
------------------
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Expand Up @@ -36,7 +36,7 @@

# General information about the project.
project = 'django-import-export'
copyright = '2012–2020, Bojan Mihelac'
copyright = '2012–2022, Bojan Mihelac'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand Down

0 comments on commit 63c1bef

Please sign in to comment.