Skip to content

Commit 06893fb

Browse files
authored
Create python-publish.yml (#82)
upgrade version to 2.3.0 (for Django v4)
1 parent 160a7ee commit 06893fb

File tree

6 files changed

+72
-58
lines changed

6 files changed

+72
-58
lines changed

.github/workflows/python-publish.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# This workflow will upload a Python Package using Twine when a release is created
2+
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3+
4+
# This workflow uses actions that are not certified by GitHub.
5+
# They are provided by a third-party and are governed by
6+
# separate terms of service, privacy policy, and support
7+
# documentation.
8+
9+
name: Upload Python Package
10+
11+
on:
12+
release:
13+
types: [published]
14+
15+
jobs:
16+
deploy:
17+
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- uses: actions/checkout@v2
22+
- name: Set up Python
23+
uses: actions/setup-python@v2
24+
with:
25+
python-version: '3.x'
26+
- name: Install dependencies
27+
run: |
28+
python -m pip install --upgrade pip
29+
pip install build
30+
- name: Build package
31+
run: python -m build
32+
- name: Publish package
33+
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
34+
with:
35+
user: __token__
36+
password: ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/pythonpublish.yml

-31
This file was deleted.

README.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ manage.py makemigrations
4141
manage.py migrate
4242
```
4343

44-
4544
#### Use vote API
4645

4746
```python
@@ -56,9 +55,13 @@ review.votes.down(user_id)
5655
# Removes a vote from the object
5756
review.votes.delete(user_id)
5857

59-
# Check if the user already voted the object
58+
# Check if the user already voted (up) the object
6059
review.votes.exists(user_id)
6160

61+
# Check if the user already voted (down) the object
62+
# import UP, DOWN from vote.models
63+
review.votes.exists(user_id, action=DOWN)
64+
6265
# Returns the number of votes for the object
6366
review.votes.count()
6467

docs/changelog.rst

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
Changelog
22
=========
33

4+
2.3.0 (2022.02.06)
5+
------------------
6+
* Add support for Django 4.0
7+
48
2.2.0 (2020.05.20)
59
------------------
610
* Add post_vote signal

setup.py

+25-23
Original file line numberDiff line numberDiff line change
@@ -4,37 +4,39 @@
44
import vote
55

66

7-
with open('README.md') as f:
7+
with open("README.md") as f:
88
README = f.read()
99

1010
# allow setup.py to be run from any path
1111
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
1212

1313
setup(
14-
name='django-vote',
15-
version='.'.join(str(i) for i in vote.VERSION),
16-
packages=find_packages(exclude=('test*',)),
14+
name="django-vote",
15+
version=".".join(str(i) for i in vote.VERSION),
16+
packages=find_packages(exclude=("test*",)),
1717
include_package_data=True,
18-
license='BSD License',
19-
description='A simple Django app to conduct vote.',
18+
description="A simple Django app to conduct vote.",
2019
long_description=README,
21-
long_description_content_type='text/markdown',
22-
url='https://github.com/shellfly/django-vote',
23-
author='shellfly',
24-
author_email='[email protected]',
20+
long_description_content_type="text/markdown",
21+
url="https://github.com/shellfly/django-vote",
22+
author="shellfly",
23+
author_email="[email protected]",
2524
classifiers=[
26-
'Development Status :: 5 - Production/Stable',
27-
'Environment :: Web Environment',
28-
'Framework :: Django',
29-
'Framework :: Django :: 1.7',
30-
'Framework :: Django :: 1.8',
31-
'Framework :: Django :: 1.9',
32-
'Framework :: Django :: 1.10',
33-
'Framework :: Django :: 2.0',
34-
'Framework :: Django :: 3.0',
35-
'Intended Audience :: Developers',
36-
'License :: OSI Approved :: BSD License',
37-
'Programming Language :: Python :: 2.7',
38-
'Programming Language :: Python :: 3.8',
25+
"Development Status :: 5 - Production/Stable",
26+
"Intended Audience :: Developers",
27+
"License :: OSI Approved :: Apache Software License",
28+
"Environment :: Web Environment",
29+
"Framework :: Django",
30+
"Framework :: Django :: 1.7",
31+
"Framework :: Django :: 1.8",
32+
"Framework :: Django :: 1.9",
33+
"Framework :: Django :: 1.10",
34+
"Framework :: Django :: 2.0",
35+
"Framework :: Django :: 3.0",
36+
"Framework :: Django :: 4.0",
37+
"Programming Language :: Python :: 2.7",
38+
"Programming Language :: Python :: 3.7",
39+
"Programming Language :: Python :: 3.8",
40+
"Programming Language :: Python :: 3.9",
3941
],
4042
)

vote/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
VERSION = (2, 2, 0)
1+
VERSION = (2, 3, 0)
22

3-
default_app_config = 'vote.apps.VoteAppConfig'
3+
default_app_config = "vote.apps.VoteAppConfig"

0 commit comments

Comments
 (0)