Skip to content

Commit 56bded0

Browse files
author
Ties Jan Hefting
committed
Add packaging configuration
A GitHub action is included to automatically publish packages when a new tag is created.
1 parent 748bbd1 commit 56bded0

File tree

6 files changed

+92
-33
lines changed

6 files changed

+92
-33
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
name: Publish PyPI package
3+
4+
on:
5+
push:
6+
branches-ignore:
7+
- '**'
8+
tags:
9+
- '**'
10+
11+
jobs:
12+
PyPI:
13+
environment: pypi_publishing_environment
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Check-out repository
17+
uses: actions/checkout@v2
18+
- name: Set up Python
19+
uses: actions/setup-python@v2
20+
with:
21+
python-version: '3.8'
22+
- name: Install dependencies
23+
run: python3 -m pip install build twine
24+
- name: Build package
25+
run: python3 -m build --sdist --wheel ./
26+
- name: Publish package
27+
run: python3 -m twine upload dist/*
28+
env:
29+
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
30+
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}

MANIFEST.in

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
graft hcaptcha_field
2+
graft py_tests
13
include LICENSE
2-
include README.rst
3-
recursive-include hcaptcha_field/templates *
4-
recursive-include docs *
4+
include README.md
5+
6+
global-exclude __pycache__
7+
global-exclude *.py[co]

hcaptcha_field/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1+
import django
2+
13
from .fields import hCaptchaField
24
from .settings import hcaptcha_settings
35
from .widgets import hCaptchaWidget
46

57

68
__all__ = ('hCaptchaField', 'hCaptchaWidget', 'hcaptcha_settings')
9+
10+
11+
if django.VERSION < (3, 2):
12+
default_app_config = 'hcaptcha_field.apps.hCaptchaFieldConfig'

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build-system]
2+
build-backend = "setuptools.build_meta"
3+
requires = ["setuptools>=42", "wheel"]

setup.cfg

Lines changed: 0 additions & 28 deletions
This file was deleted.

setup.py

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,48 @@
1-
from setuptools import setup
1+
import setuptools
22

3-
setup()
3+
4+
with open('README.md', 'r', encoding='utf-8') as f:
5+
LONG_DESCRIPTION = f.read()
6+
7+
8+
setuptools.setup(
9+
# Metadata
10+
name='django-hcaptcha-field',
11+
version='0.9',
12+
license='BSD',
13+
author='Ties Jan Hefting',
14+
author_email='hello@tiesjan.com',
15+
description='Django hCaptcha Field provides a simple way to protect your Django forms using hCaptcha.',
16+
long_description=LONG_DESCRIPTION,
17+
long_description_content_type='text/markdown',
18+
url='https://github.com/tiesjan/django-hcaptcha-field',
19+
project_urls={
20+
'Bugs': 'https://github.com/tiesjan/django-hcaptcha-field/issues',
21+
},
22+
classifiers=[
23+
'Development Status :: 4 - Beta',
24+
'Environment :: Web Environment',
25+
'Framework :: Django :: 2.2',
26+
'Framework :: Django :: 3.0',
27+
'Framework :: Django :: 3.1',
28+
'Framework :: Django :: 3.2',
29+
'Intended Audience :: Developers',
30+
'License :: OSI Approved :: BSD License',
31+
'Operating System :: OS Independent',
32+
'Programming Language :: Python :: 3.5',
33+
'Programming Language :: Python :: 3.6',
34+
'Programming Language :: Python :: 3.7',
35+
'Programming Language :: Python :: 3.8',
36+
'Programming Language :: Python :: 3.9',
37+
'Topic :: Internet :: WWW/HTTP',
38+
],
39+
40+
# Options
41+
packages=setuptools.find_packages(exclude=('py_tests*',)),
42+
include_package_data=True,
43+
zip_safe=False,
44+
python_requires='>=3.5',
45+
install_requires=(
46+
'Django>=2.2,<=4.0',
47+
)
48+
)

0 commit comments

Comments
 (0)