Skip to content
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
32 changes: 16 additions & 16 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@ on:
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
python -m pip install build
- name: Build distributions
run: python -m build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
*.pyc
__pycache__/
*.db
.coverage
MANIFEST
Expand Down
4 changes: 1 addition & 3 deletions dynamic_forms/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
from django import forms

__version__ = "1.0.0"


def call_if_callable(value, *args, **kwargs):
return value(*args, **kwargs) if callable(value) else value
Expand All @@ -18,7 +16,7 @@ def __init__(self, field_class, *args, **kwargs):
def make_real_field(self, form):
return self.field_class(
*(call_if_callable(arg, form) for arg in self.args),
**{name: call_if_callable(arg, form) for name, arg in self.kwargs.items()}
**{name: call_if_callable(arg, form) for name, arg in self.kwargs.items()},
)

def should_be_included(self, form):
Expand Down
21 changes: 21 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[build-system]
requires = ["setuptools>=61"]
build-backend = "setuptools.build_meta"

[project]
name = "django-forms-dynamic"
version = "1.0.0"
description = "Resolve form field arguments dynamically when a form is instantiated, not when it's declared."
readme = "README.md"
requires-python = ">=3.10"
license = "BSD-3-Clause"
license-files = ["LICENSE"]
authors = [{ name = "DabApps", email = "hello@dabapps.com" }]

[project.urls]
Homepage = "https://github.com/dabapps/django-forms-dynamic"
Changelog = "https://github.com/dabapps/django-forms-dynamic/releases"
Issues = "https://github.com/dabapps/django-forms-dynamic/issues"

[tool.setuptools.packages.find]
include = ["dynamic_forms*"]
77 changes: 0 additions & 77 deletions setup.py

This file was deleted.