Skip to content
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

Feature/pep621 #232

Open
wants to merge 14 commits into
base: develop
Choose a base branch
from
Open
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
16 changes: 0 additions & 16 deletions .bumpversion.cfg

This file was deleted.

48 changes: 48 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Release to PyPI
on:
push:
tags: ["*"]

env:
dists-artifact-name: python-package-distributions

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
cache-dependency-glob: "pyproject.toml"
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build package
run: uv build --python 3.13 --python-preference only-managed --sdist --wheel . --out-dir dist
- name: Store the distribution packages
uses: actions/upload-artifact@v4
with:
name: ${{ env.dists-artifact-name }}
path: dist/*

release:
needs:
- build
runs-on: ubuntu-latest
environment:
name: release
url: https://pypi.org/project/pytest-echo/${{ github.ref_name }}
permissions:
id-token: write
steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: ${{ env.dists-artifact-name }}
path: dist/
- name: Publish to PyPI
uses: pypa/[email protected]
with:
attestations: true
56 changes: 36 additions & 20 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
name: Test

on:
workflow_dispatch:
push:
branches:
- master
- develop
branches: [ "develop" ]
tags-ignore: [ "**" ]
pull_request:
schedule:
- cron: "0 8 * * *"

jobs:
lint:
Expand All @@ -30,31 +32,45 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [ "3.9", "3.10", "3.11" ]
django-version: [ "3.2", "4.2" ]
python-version: [ "311", "312", "313" ]
django-version: [ "32", "42", "51" ]
env:
PY_VER: ${{ matrix.python-version}}
DJ_VER: ${{ matrix.django-version}}
CELERY_BROKER_URL: redis://redis:6379/0
CELERY_ALWAYS_EAGER: true
steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}
enable-cache: true
cache-dependency-glob: "pyproject.toml"
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Install dependencies
run: python -m pip install --upgrade pip .[test] "django==${DJ_VER}.*"
- name: Install tox
run: uv tool install --python-preference only-managed --python 3.13 tox --with tox-uv

- name: Install Python
if: matrix.python-version != '3.13'
run: uv python install --python-preference only-managed ${{ matrix.python-version}}

- name: Test with
run: py.test tests/ -v
- name: Setup test suite ${{ env.DJ_VER }}-${{ env.PY_VER }}
run: tox run -vv --notest --skip-missing-interpreters false -e d${{ env.DJ_VER }}-py${{ env.PY_VER }}

- uses: codecov/codecov-action@v1
- name: Run test suite
# COV_CMD=$(if [ ${{ env.DJ_VER }}-${{ env.PY_VER }} == 51-312 ]; then echo "--cov=pytest_echo --cov-report=xml"; else echo ; fi)
run: |
tox run --skip-pkg-install -e d${{ env.DJ_VER }}-py${{ env.PY_VER }}
env:
PYTEST_ADDOPTS: "-vv --durations=20"
DIFF_AGAINST: HEAD
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
if: ${{ success() && matrix.python-version == 3.13 }}
with:
# files: ./coverage1.xml,./coverage2.xml # optional
# flags: unittests # optional
# name: codecov-umbrella # optional
# fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)
env_vars: OS
name: codecov-pytest-order
token: ${{ secrets.CODECOV_TOKEN }}
17 changes: 7 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
.DS_Store
.*
~*
*.log
*.pot
*.pyc
*.egg-info
*.sqlite
.idea
.tox
.cache
.coverage
src/adminactions/version.py
/dist
/build
/docs/build
/MANIFEST
coverage.xml
sonar-project.properties
.scannerwork
Pipfile
Pipfile.lock
poetry.lock
.venv/
uv.lock
!.pre-commit-config.yaml
!.github
!.gitignore
!.coveragerc
54 changes: 34 additions & 20 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,35 @@
repos:
- repo: local
hooks:
# Configuration for black exists in pyproject.toml,
# but we let pre-commit take care of the file filtering.
- id: black
name: black
entry: black
language: python
types: [python]
require_serial: true
- id: isort
name: isort
entry: isort
language: python
types: [python]
- id: flake8
name: flake8
entry: flake8
language: python
types: [python]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.31.0
hooks:
- id: check-github-workflows
args: [ "--verbose" ]
- repo: https://github.com/tox-dev/tox-ini-fmt
rev: "1.5.0"
hooks:
- id: tox-ini-fmt
args: [ "-p", "lint" ]
- repo: https://github.com/tox-dev/pyproject-fmt
rev: "v2.5.0"
hooks:
- id: pyproject-fmt
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.9.4"
hooks:
- id: ruff-format
- id: ruff
args: [ "--fix", "--unsafe-fixes", "--exit-non-zero-on-fix" ]
- repo: https://github.com/adamchainz/djade-pre-commit
rev: "1.3.2"
hooks:
- id: djade
args: [ --target-version, "5.1" ] # Replace with Django version
- repo: meta
hooks:
- id: check-hooks-apply
- id: check-useless-excludes
1 change: 0 additions & 1 deletion AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,3 @@ Contributors
.. _`@asfaltboy`: https://github.com/asfaltboy
.. _`@int-ua`: https://github.com/int-ua
.. _`@Djailla`: https://github.com/Djailla

6 changes: 6 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
Release 2.4
===========
* fixes #227
* add ability to asynchronously mass_update M2M


Release 2.3
===========
* Add support to foreignkeys to bulk updates ( @see https://github.com/saxix/django-adminactions/pull/224/files)
Expand Down
28 changes: 13 additions & 15 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,29 +1,27 @@
include README.rst
graft docs
include CHANGELOG
include LICENSE
include src/*.py
include README.md

include README.md
include MANIFEST.in
include AUTHORS.rst
include CHANGES
include LICENSE
include setup.py
include setup.cfg
include tox.ini
include *.py
include Makefile

exclude .bumpversion.cfg
exclude .editorconfig
exclude manage.py
exclude .*
exclude .act
exclude *

recursive-include docs *
recursive-include src *.css
recursive-include src *.js
recursive-include src *.pip
recursive-include src *.po
recursive-include src *.txt
recursive-include src/adminactions *.py
recursive-include src/adminactions *.html
recursive-include tests *
recursive-include src/adminactions *.*
recursive-exclude .act *

global-exclude *.pyc
global-exclude __pycache__
global-exclude ~*
global-exclude *~
global-exclude .*
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ demo:
PYTHONPATH=${PWD}:${PWD}/tests:${PWD}/src django-admin.py runserver --settings=demo.settings

lint:
@flake8 src/ tests/
@isort -c src/
pre-commit run --all


clean:
Expand Down
34 changes: 16 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
django-adminactions
===================

# django-adminactions

[![Pypi](https://badge.fury.io/py/django-adminactions.svg)](https://badge.fury.io/py/django-adminactions)
[![coverage](https://codecov.io/github/saxix/django-adminactions/coverage.svg?branch=develop)](https://codecov.io/github/saxix/django-adminactions?branch=develop)
[![Test](https://github.com/saxix/django-adminactions/actions/workflows/test.yml/badge.svg)](https://github.com/saxix/django-adminactions/actions/workflows/test.yml)
[![Docs](https://readthedocs.org/projects/django-adminactions/badge/?version=latest)](https://django-adminactions.readthedocs.io/en/latest/)
[![Django](https://img.shields.io/pypi/frameworkversions/django/django-adminactions)](https://pypi.org/project/django-adminactions/)


Collection of useful actions to use with
django.contrib.admin.ModelAdmin and/or django.contrib.admin.AdminSite
Expand All @@ -14,21 +14,19 @@ Please see the changelog at http://django-adminactions.readthedocs.org/en/latest

#### Actions

* Export as CSV
* Export as Excel
* Export as fixture
* Export delete tree
* Mass update records
* Graph queryset
* Merge records
* Find Duplicates
* Bulk Update

- Export as CSV
- Export as Excel
- Export as fixture
- Export delete tree
- Mass update records
- Graph queryset
- Merge records
- Find Duplicates
- Bulk Update

#### Project Links


- Code: https://github.com/saxix/django-adminactions
- Documentation: https://django-adminactions.readthedocs.org/en/latest/
- Issue Tracker: https://github.com/saxix/django-adminactions/issues?sort
- Download Package: https://pypi.org/project/django-adminactions/
- Code: https://github.com/saxix/django-adminactions
- Documentation: https://django-adminactions.readthedocs.org/en/latest/
- Issue Tracker: https://github.com/saxix/django-adminactions/issues?sort
- Download Package: https://pypi.org/project/django-adminactions/
Loading
Loading