Skip to content

Commit

Permalink
Merge 0003034 into 5c3c8dc
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewhegarty committed Apr 13, 2024
2 parents 5c3c8dc + 0003034 commit 5010aa8
Show file tree
Hide file tree
Showing 173 changed files with 12,426 additions and 7,382 deletions.
8 changes: 8 additions & 0 deletions .coveragerc
@@ -0,0 +1,8 @@
[run]
branch = False
source =
import_export
parallel = True
omit =
__init__.py
_version.py
4 changes: 4 additions & 0 deletions .flake8
@@ -0,0 +1,4 @@
[flake8]
exclude = build,.git,.tox
extend-ignore = E203
max-line-length = 88
75 changes: 75 additions & 0 deletions .github/workflows/release.yml
@@ -0,0 +1,75 @@
name: Release

on:
release:
types:
- published

jobs:
build:
name: Build Distribution 📦
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install pypa/build
run: >-
SETUPTOOLS_SCM_DEBUG=1
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: python -m build
- name: Store the distribution packages
uses: actions/upload-artifact@v3
with:
name: python-package-distributions
path: dist/

publish-to-pypi:
name: >-
Publish Python 🐍 distribution 📦 to PyPI
needs:
- build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/django-import-export
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- name: Download all the dists
uses: actions/download-artifact@v3
with:
name: python-package-distributions
path: dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

publish-to-testpypi:
name: Publish Python 🐍 distribution 📦 to TestPyPI
needs:
- build
runs-on: ubuntu-latest
environment:
name: testpypi
url: https://test.pypi.org/p/django-import-export
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- name: Download all the dists
uses: actions/download-artifact@v3
with:
name: python-package-distributions
path: dist/
- name: Publish distribution 📦 to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
@@ -1,4 +1,4 @@
name: django-import-export CI
name: test

on:
push:
Expand All @@ -7,6 +7,8 @@ on:
pull_request:
branches:
- main
# temporary - remove after release 4
- release-4

jobs:
test:
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Expand Up @@ -12,8 +12,12 @@ dist/
*.python-version
.coverage
*.sw[po]
.DS_Store

# IDE support
.vscode

tests/database.db

# generated by setuptools-scm
import_export/_version.py
4 changes: 4 additions & 0 deletions AUTHORS
Expand Up @@ -145,4 +145,8 @@ The following is a list of much appreciated contributors:
* bgelov (Oleg Belov)
* EricOuma (Eric Ouma)
* ZibingZhang (Zibing Zhang)
* Glay00 (Gleb Gorelov)
* PrashansaChaudhary (Prashansa Chaudhary)
* Vedang Barhate (bvedang)
* RobTilton (Robert Tilton)
* ulliholtgrave
6 changes: 0 additions & 6 deletions MANIFEST.in

This file was deleted.

17 changes: 7 additions & 10 deletions Makefile
@@ -1,4 +1,4 @@
.PHONY: clean-pyc clean-build release docs help
.PHONY: clean-pyc clean-build docs help
.PHONY: lint test coverage test-codecov
.DEFAULT_GOAL := help
RUN_TEST_COMMAND=PYTHONPATH=".:tests:${PYTHONPATH}" django-admin test core --settings=settings
Expand All @@ -11,6 +11,7 @@ clean-build: ## remove build artifacts
rm -fr build/
rm -fr dist/
rm -fr *.egg-info
rm -f import_export/_version.py

clean-pyc: ## remove Python file artifacts
find . -name '*.pyc' -exec rm -f {} +
Expand All @@ -29,30 +30,26 @@ messages: ## generate locale file translations
cd import_export && django-admin makemessages -a && django-admin compilemessages && cd ..

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

sdist: clean ## package
python setup.py sdist
ls -l dist

release: clean install-deploy-requirements sdist ## package and upload a release
fullrelease

install-base-requirements: ## install package requirements
pip install -r requirements/base.txt

install-test-requirements: ## install requirements for testing
pip install -r requirements/test.txt

install-deploy-requirements: ## install requirements for deployment
pip install -r requirements/deploy.txt

install-docs-requirements: ## install requirements for docs
pip install -r requirements/docs.txt

install-requirements: install-base-requirements install-test-requirements install-deploy-requirements install-docs-requirements
install-requirements: install-base-requirements install-test-requirements install-docs-requirements

build-html-doc: ## builds the project documentation in HTML format
## builds the project documentation in HTML format
## run `pip install -e .` first if running locally
build-html-doc:
DJANGO_SETTINGS_MODULE=tests.settings make html -C docs
4 changes: 4 additions & 0 deletions README.rst
Expand Up @@ -26,10 +26,14 @@ django-import-export
.. image:: https://static.pepy.tech/personalized-badge/django-import-export?period=month&units=international_system&left_color=black&right_color=blue&left_text=Downloads/month
:target: https://pepy.tech/project/django-import-export

.. image:: https://img.shields.io/twitter/url/https/twitter.com/django_import.svg?style=social&label=Follow%20%40django_import
:alt: Follow us on X

django-import-export is a Django application and library for importing
and exporting data from a variety of formats. Includes Django Admin site integration.

* Documentation: https://django-import-export.readthedocs.io/en/stable/
* GitHub: https://github.com/django-import-export/django-import-export/
* Free software: BSD license
* PyPI: https://pypi.org/project/django-import-export/
* Twitter / X: https://twitter.com/django_import
72 changes: 20 additions & 52 deletions RELEASE.md
@@ -1,65 +1,33 @@
## Release process

#### Pre release
#### 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.
- If pushing directly to `main` branch, ensure this is done on the correct remote repo.
- `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. It is recommended to run this prior to any minor release.
- This creates updates to all translation files so there is no need to commit these unless there have been any translation changes.
- If 'no module named settings' error is seen, try unsetting `DJANGO_SETTINGS_MODULE` environment variable.

```bash
# check out clean version
# all git operations will be run against this source repo
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 --exists-action=w --no-cache-dir -r requirements/deploy.txt

# zest.releaser pre-release
# (you can set the correct version in this step)
prerelease
```
Ensure that ``CHANGELOG.rst`` is up-to-date with the correct version number and release date.

#### 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
To create a new published release, follow the instructions [here](https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository).
Ensure you create the new tag to correspond with the release as required.

# resets the version and pushes changes to origin
postrelease
1. Go to the [Releases](https://github.com/django-import-export/django-import-export/releases) page
2. Click 'Draft a new release'
3. Choose or create a new tag
4. Choose the desired branch (if not `main`)
5. Check 'Set as a pre-release' or 'Set as the latest release' as appropriate
6. Generate release notes if desired.
7. Click 'Publish release'

# remove the rel copy - no longer required
deactivate
cd ..
rm -rf django-import-export-rel
```
The `release` github workflow will run and publish the release binaries to both test.pypi.org and pypi.org.

#### Add Release to Github
### Check readthedocs

- Go to [Github releases](https://github.com/django-import-export/django-import-export/releases)
- Click 'Draft a new release'
- Enter the version number (e.g. 3.1.0)
- Select the correct tag
- Publish the release
[readthedocs](https://readthedocs.org/projects/django-import-export/) integration is used to publish documentation.
The webhook endpoint on readthedocs is configured using
[these instructions](https://docs.readthedocs.io/en/latest/guides/setup/git-repo-manual.html).

### Check readthedocs
This is implemented using a Webhook defined in the Github repo (Settings / Webhooks).

readthedocs should be checked after each release to ensure that the docs have built correctly.
Login to [readthedocs.org](https://readthedocs.org) to check that the build ran OK (click on 'Builds' tab).

For pre-releases, the release version has to be activated via the readthedocs UI before it can be built.
Binary file added docs/_static/images/change-form-export.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/_static/images/django-import-export-action.png
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/images/export-button.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/_static/images/export_workflow.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/images/import-button.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/_static/images/import_workflow.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/_static/images/select-for-export.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 5010aa8

Please sign in to comment.