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

feat: advertise constraints in setup.py #88

Open
wants to merge 132 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
132 commits
Select commit Hold shift + click to select a range
33e9a24
Important fix! Remove HTML tags from Markdown code.
rocha Aug 25, 2012
e2e8455
Merge remote-tracking branch 'rocha/edx_release' into edx_release
Aug 25, 2012
ac906ab
Make the urlize parser more strict
benjaoming Apr 23, 2013
791026a
fix syntax error in views/article
adampalay Jul 18, 2013
41815e2
Merge pull request #1 from edx/fix/adam/superuser
adampalay Jul 19, 2013
5f1fe41
Use ugettext_lazy to prevent early translation.
Feb 10, 2014
00424a1
Merge pull request #3 from edx/ned/use-ugettext_lazy
nedbat Feb 10, 2014
7aa9d0c
Fixes MAT-4
Feb 24, 2014
cd0b2b3
Merge pull request #4 from edx/dcs/mat-4
Feb 28, 2014
8b8602b
Upgrade to Django v1.8
symbolist Sep 21, 2015
59424bd
Remove south from the requirements
Sep 23, 2015
100d96b
Fix a message with incorrect format specifiers
Sep 23, 2015
dc121c3
Update the version number
Sep 27, 2015
3341a98
fix RemovedInDjango19Warning warnings
muhammad-ammar Oct 21, 2015
0336f5e
bump library version
muhammad-ammar Nov 5, 2015
3cd307f
Add a migration for the removed ArticleSubscription model
Nov 18, 2015
98a0dd6
Merge pull request #16 from edx/ned/dj18-fix-notification-migration
nedbat Nov 19, 2015
5797ed6
Fix a migration that could never have run successfully
Nov 20, 2015
629fc2f
Merge pull request #18 from edx/ned/fix-0002-migration
nedbat Nov 23, 2015
36e8706
Update django wiki to support multi-tenancy
saleem-latif Feb 23, 2016
614c568
Merge pull request #19 from edx/saleem-latif/WL-322
saleem-latif Mar 4, 2016
77caec3
set WIKI_REQUEST_CACHE_MIDDLEWARE_CLASS to None if settings is not co…
saleem-latif Mar 7, 2016
a9b8b0e
Merge pull request #20 from edx/saleem-latif/WL-322-test-failure
mattdrayer Mar 14, 2016
cd6de29
Change from deprecated IPAddressField model field to the new
Jul 6, 2016
ff4cd9b
Get rid of unneeded whitespace.
Jul 6, 2016
cdd6999
Merge pull request #21 from edx/jeskew/fix_model_deprecation_warning_3
Jul 6, 2016
4a3dc1f
Ensure that CreateForm fails when slug field is longer than the maxim…
benjaoming Oct 30, 2012
6462655
Increase slug size from 50 to 255.
mtyaka Jul 12, 2016
f57db71
Merge pull request #22 from open-craft/mtyaka/increase-slug-size
mtyaka Aug 24, 2016
906d704
Fix a11y issues.
Feb 7, 2017
144a816
Merge pull request #23 from edx/christina/a11y
Feb 10, 2017
5e0c937
Update test db to work with our current migations.
Jul 21, 2017
7df3898
Remove url from futures.
Jul 25, 2017
da730eb
Move from init to models file.
Jul 25, 2017
2eeedf8
URL pattern upgrades
Jul 25, 2017
5600743
1.9 upgrades
Jul 25, 2017
f6e9011
1.9 upgrades.
Jul 25, 2017
d263d7c
get_form updates
Jul 25, 2017
88a6310
1.10 updates.
Jul 26, 2017
62ececa
Django 1.11 updates.
Jul 27, 2017
f749c67
Bump version and minor cleanups.
Jul 27, 2017
f3dce90
Merge pull request #24 from edx/christina/1_11_upgrade
Aug 1, 2017
65514af
Don't import plugin models in main migrations
jmbowman Sep 7, 2017
2b4da25
Merge pull request #25 from edx/jmbowman/migrations_cleanup
Sep 11, 2017
9cbcf25
Fixed migration 0005
jmbowman Sep 11, 2017
00aadbb
Merge pull request #26 from edx/jmbowman/migration_fix
Sep 12, 2017
51b6401
Include plugin models again
jmbowman Sep 13, 2017
c0a6698
Merge pull request #27 from edx/jmbowman/import_plugin_models
Sep 13, 2017
b2d3c93
Fix deprecated safe_mode
awaisdar001 Nov 3, 2017
f7b9a60
Merge pull request #28 from edx/aj/remove-deprecated-safe-mode
awaisdar001 Nov 6, 2017
8770c27
Code refactor for automated translation job
Ayub-Khan Nov 21, 2017
b232cff
Merge pull request #29 from edx/LEARNER-2656-code-refactor-to-resolve…
Ayub-Khan Nov 23, 2017
735179e
Fix pinned version of Django to be <2.
bmedx Dec 4, 2017
c095baa
Merge pull request #30 from edx/bmedx/fix_pinned_django_version
bmedx Dec 4, 2017
e27c8cb
Bump version to 0.0.16
bmedx Dec 4, 2017
b108ad3
Merge pull request #31 from edx/bmedx/bump_version_0_0_16
bmedx Dec 4, 2017
913c386
PLAT-1945 Fix deprecated Markdown extension initialization
jmbowman Feb 6, 2018
9806353
Merge pull request #32 from edx/jmbowman/PLAT-1945
Feb 7, 2018
679dac9
Add method to retire user ip_address
Apr 30, 2018
a6bd51e
Merge pull request #34 from edx/yro/EDUC-2701
yro Apr 30, 2018
3b55783
Retire User from RevisionPluginRevision
Apr 30, 2018
b66428e
Merge pull request #35 from edx/yro/EDUCATOR-2702
yro May 2, 2018
7a16876
Added trimmed to blocktrans where newline or endline
Ayub-Khan Jul 9, 2018
da6a6bf
Merge pull request #37 from edx/fix-i18n-issue
Ayub-Khan Jul 9, 2018
61eaa20
Clean XSS in wiki content
DawoudSheraz Dec 28, 2018
ee9861e
Merge pull request #47 from edx/dsheraz/wiki_content_fix
DawoudSheraz Dec 31, 2018
0904b14
Clean anchor tags to counter XSS
DawoudSheraz Feb 6, 2019
ba76071
Merge pull request #48 from edx/dsheraz/js_href
DawoudSheraz Feb 11, 2019
4e6910c
Modernize execute on all folders.
awais786 Jul 22, 2019
2dd7d57
Merge pull request #50 from edx/awais786/BOM-68
awais786 Jul 25, 2019
c47aa15
importing six here is a problem. Because when edx-platform installs f…
awais786 Jul 30, 2019
310d250
Merge pull request #51 from edx/awais786/BOM-68-re-fix
awais786 Jul 30, 2019
cfd26ba
BOM-1111
awais786 Dec 20, 2019
f309a73
Merge pull request #52 from edx/awais786/BOM-1111
awais786 Dec 23, 2019
51fcc3c
BOM-1111
awais786 Dec 23, 2019
73dd08c
BOM-1111
awais786 Dec 23, 2019
bf7f277
Merge pull request #53 from edx/awais786/BOM-1111-p2
awais786 Dec 23, 2019
3798202
Merge pull request #54 from edx/awais786/BOM-1111-authenticate-ana
awais786 Dec 23, 2019
44efc23
Fix some Django20 deprecation warnings.
Sep 27, 2018
752069f
Merge pull request #38 from edx/jeskew/fix_django20_deprecation_warning
awais786 Jan 8, 2020
a229fc5
BOM-1146
awais786 Jan 10, 2020
b86e6a2
Merge pull request #55 from edx/awais786/BOM-1146
awais786 Jan 10, 2020
a7512c8
BOM-1399
awais786 Mar 12, 2020
3e99b06
Merge pull request #56 from edx/awais786/BOM-1399__
awais786 Mar 13, 2020
084aba4
BOM-1482 Removed Django Constraint
UsamaSadiq Apr 3, 2020
4ceac47
Merge pull request #57 from edx/usamasadiq/bom-1482
UsamaSadiq Apr 3, 2020
db225be
Create root as a class-based view.
ericfab179 Jun 11, 2020
f648034
Merge pull request #60 from eduNEXT/eric/django_updates
awais786 Jun 15, 2020
50198d7
Update classifiers.
ericfab179 Jun 16, 2020
bfbec8b
Address requirements comments.
ericfab179 Jul 1, 2020
d1c468d
Merge pull request #61 from eduNEXT/eric/oep-18
awais786 Jul 1, 2020
c2fe2d0
Initial changes to support tests.
ericfab179 Jun 6, 2020
e1a35de
Merge pull request #59 from eduNEXT/eric/oep-18_py38
awais786 Jul 1, 2020
f6928ac
This pull request was generated by the cleanup-python-code Jenkins jo…
edx-requirements-bot Aug 21, 2020
be123df
removed obsolete elements from openedx.yaml (#63)
mraarif Aug 24, 2020
13d9617
Make reverse() resilient to 0-length args.
iloveagent57 Sep 15, 2020
9ce592d
Merge pull request #64 from edx/aed/fix-reverse
mattcarter Sep 15, 2020
afc5100
dropped support for python 3.5 and some refactoring
mraarif Jan 14, 2021
942ff68
Upgrade markdown version and fix tests
UsamaSadiq Jan 14, 2021
caeb1cb
Merge pull request #66 from edx/upgrading-markdown-version
UsamaSadiq Jan 14, 2021
8559e81
Remove six and fix django version handling
UsamaSadiq Jan 15, 2021
51e103b
Merge pull request #65 from edx/drop-python35-support
UsamaSadiq Jan 18, 2021
bc3d089
Adding Apache license to repo
Jan 19, 2021
be277bd
Revert "Adding Apache license to repo"
Jan 20, 2021
1af03bd
chore: Incorporate wiki improvements from upstream repository.
Jul 30, 2021
9961987
Merge pull request #72 from edx/juliasq/TNL-8589_wiki_improvements
Jul 30, 2021
f9ae6ac
Chore: Bump version to 1.0.2
Jul 30, 2021
cd7c690
Create upgrade-python-requirements.yml
Sep 3, 2021
6fe19fc
Merge pull request #74 from edx/make-upgrade-job
Sep 3, 2021
47493ff
fix: branch name in upgrade job
mzulqarnain1 Sep 3, 2021
b4ea012
Merge pull request #75 from edx/change-branch
Sep 3, 2021
0c48cc0
chore: Updating Python Requirements
edx-requirements-bot Sep 3, 2021
bac6135
Merge pull request #76 from edx/jenkins/upgrade-python-requirements-b…
UsamaSadiq Sep 3, 2021
4662bed
chore: Updating Python Requirements
edx-requirements-bot Sep 7, 2021
b8cc9b0
Merge pull request #77 from edx/jenkins/upgrade-python-requirements-b…
Sep 7, 2021
a056654
chore: Updating Python Requirements
edx-requirements-bot Sep 14, 2021
4163ab1
Merge pull request #78 from edx/jenkins/upgrade-python-requirements-b…
Sep 14, 2021
6c6db16
chore: Updating Python Requirements
edx-requirements-bot Sep 21, 2021
9c5f22c
Merge pull request #79 from edx/jenkins/upgrade-python-requirements-4…
Sep 21, 2021
9d921b2
chore: Updating Python Requirements
edx-requirements-bot Sep 28, 2021
2975add
Merge pull request #80 from edx/jenkins/upgrade-python-requirements-9…
UsamaSadiq Sep 28, 2021
2775d98
chore: Updating Python Requirements
edx-requirements-bot Oct 5, 2021
f623161
Merge pull request #81 from edx/jenkins/upgrade-python-requirements-2…
UsamaSadiq Oct 5, 2021
3bd9307
build: use the organization commitlint check
nedbat Oct 7, 2021
1fd492c
chore: Updating Python Requirements
edx-requirements-bot Oct 12, 2021
bb524c8
Merge pull request #83 from edx/jenkins/upgrade-python-requirements-3…
UsamaSadiq Oct 12, 2021
0acdb16
chore: Updating Python Requirements (#84)
edx-requirements-bot Oct 19, 2021
9808d8f
chore: Updating Python Requirements (#85)
edx-requirements-bot Oct 26, 2021
54bf670
chore: Updating Python Requirements
edx-requirements-bot Nov 2, 2021
349374d
Merge pull request #86 from edx/jenkins/upgrade-python-requirements-9…
iamsobanjaved Nov 2, 2021
13c9268
chore: Updating Python Requirements (#87)
edx-requirements-bot Nov 9, 2021
f0dd7e8
feat: advertise constraints in setup.py
edx-requirements-bot Nov 9, 2021
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
35 changes: 35 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Python CI

on:
push:
branches: [master]
pull_request:
branches:
- '**'

jobs:
run_tests:
name: Tests
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04]
python-version: ['3.8']
toxenv: [django22, django30, django31]
steps:
- uses: actions/checkout@v1
- name: setup python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install pip
run: pip install -r requirements/pip.txt

- name: Install Dependencies
run: pip install -r requirements/ci.txt

- name: Run Tests
env:
TOXENV: ${{ matrix.toxenv }}
run: tox
10 changes: 10 additions & 0 deletions .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Run commitlint on the commit messages in a pull request.

name: Lint Commit Messages

on:
- pull_request

jobs:
commitlint:
uses: edx/.github/.github/workflows/commitlint.yml@master
68 changes: 68 additions & 0 deletions .github/workflows/upgrade-python-requirements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Upgrade Requirements

on:
schedule:
# will start the job at 2 every Tuesday (UTC)
- cron: "0 2 * * 2"
workflow_dispatch:
inputs:
branch:
description: "Target branch to create requirements PR against"
required: true
default: 'edx_release'

jobs:
upgrade_requirements:
runs-on: ubuntu-20.04

strategy:
matrix:
python-version: ["3.8"]

steps:
- name: setup target branch
run: echo "target_branch=$(if ['${{ github.event.inputs.branch }}' = '']; then echo 'edx_release'; else echo '${{ github.event.inputs.branch }}'; fi)" >> $GITHUB_ENV

- uses: actions/checkout@v1
with:
ref: ${{ env.target_branch }}

- name: setup python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: make upgrade
run: |
cd $GITHUB_WORKSPACE
make upgrade

- name: setup testeng-ci
run: |
git clone https://github.com/edx/testeng-ci.git
cd $GITHUB_WORKSPACE/testeng-ci
pip install -r requirements/base.txt
- name: create pull request
env:
GITHUB_TOKEN: ${{ secrets.REQUIREMENTS_BOT_GITHUB_TOKEN }}
GITHUB_USER_EMAIL: ${{ secrets.REQUIREMENTS_BOT_GITHUB_EMAIL }}
run: | # replace user-reviewers and team-reviewers accordingly
cd $GITHUB_WORKSPACE/testeng-ci
python -m jenkins.pull_request_creator --repo-root=$GITHUB_WORKSPACE \
--target-branch="${{ env.target_branch }}" --base-branch-name="upgrade-python-requirements" \
--commit-message="chore: Updating Python Requirements" --pr-title="Python Requirements Update" \
--pr-body="Python requirements update.Please review the [changelogs](https://openedx.atlassian.net/wiki/spaces/TE/pages/1001521320/Python+Package+Changelogs) for the upgraded packages." \
--user-reviewers="" --team-reviewers="arbi-bom" --delete-old-pull-requests

- name: Send failure notification
if: ${{ failure() }}
uses: dawidd6/action-send-mail@v3
with:
server_address: email-smtp.us-east-1.amazonaws.com
server_port: 465
username: ${{secrets.EDX_SMTP_USERNAME}}
password: ${{secrets.EDX_SMTP_PASSWORD}}
subject: Upgrade python requirements workflow failed in ${{github.repository}}
to: [email protected] # replace the email with team's email address
from: github-actions <[email protected]>
body: Upgrade python requirements workflow in ${{github.repository}} failed! For details see "github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,5 @@ virtualenv
# text editors
*~
*.swp

.idea/
11 changes: 11 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
language: python
python:
- 3.8
install:
- pip install -r requirements/ci.txt
env:
- TOXENV=py38-django22
- TOXENV=py38-django30
- TOXENV=py38-django31
script:
- tox
9 changes: 9 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
include CHANGELOG.rst
include CONTRIBUTING.rst
include LICENSE.txt
include README.rst
recursive-include wiki *.html *.png *.gif *js *.css *jpg *jpeg *svg *py *.txt *.json
recursive-include django_notify *.html *.png *.gif *js *.css *jpg *jpeg *svg *py *.txt *.json
include requirements/base.in

include requirements/constraints.txt
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
upgrade: export CUSTOM_COMPILE_COMMAND=make upgrade
upgrade:
pip install -q -r requirements/pip_tools.txt
pip-compile --upgrade --allow-unsafe --rebuild -o requirements/pip.txt requirements/pip.in
pip-compile --upgrade -o requirements/pip_tools.txt requirements/pip_tools.in
pip-compile --upgrade -o requirements/base.txt requirements/base.in
pip-compile --upgrade -o requirements/docs.txt requirements/docs.in
pip-compile --upgrade -o requirements/test.txt requirements/test.in
pip-compile --upgrade -o requirements/tox.txt requirements/tox.in
pip-compile --upgrade -o requirements/ci.txt requirements/ci.in
# Let tox control the Django version for tests
grep -e "^django==" requirements/base.txt > requirements/django.txt
sed '/^[dD]jango==/d' requirements/test.txt > requirements/test.tmp
mv requirements/test.tmp requirements/test.txt
40 changes: 0 additions & 40 deletions django_notify/__init__.py
Original file line number Diff line number Diff line change
@@ -1,40 +0,0 @@
from django.contrib.contenttypes.models import ContentType
from django.db.models import Model
from django.utils.translation import ugettext as _

import models

_disable_notifications = False

def notify(message, key, target_object=None, url=None):
"""
Notify subscribing users of a new event. Key can be any kind of string,
just make sure to reuse it where applicable! Object_id is some identifier
of an object, for instance if a user subscribes to a specific comment thread,
you could write:

notify("there was a response to your comment", "comment_response",
target_object=PostersObject,
url=reverse('comments:view', args=(PostersObject.id,)))

The below example notifies everyone subscribing to the "new_comments" key
with the message "New comment posted".

notify("New comment posted", "new_comments")

"""

if _disable_notifications:
return 0

if target_object:
if not isinstance(target_object, Model):
raise TypeError(_(u"You supplied a target_object that's not an instance of a django Model."))
object_id = target_object.id
else:
object_id = None

objects = models.Notification.create_notifications(key, object_id=object_id,
message=message, url=url)
return len(objects)

2 changes: 1 addition & 1 deletion django_notify/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
admin.site.register(models.NotificationType)
admin.site.register(models.Notification)
admin.site.register(models.Settings)
admin.site.register(models.Subscription)
admin.site.register(models.Subscription)
12 changes: 6 additions & 6 deletions django_notify/decorators.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# -*- coding: utf-8 -*-
from django.utils import simplejson as json
from django.http import HttpResponse
import json

from django.contrib.auth.decorators import login_required
from django.http import HttpResponse

import django_notify


def disable_notify(func):
"""Disable notifications. Example:

Expand All @@ -25,7 +26,7 @@ def login_required_ajax(func):

def wrap(request, *args, **kwargs):
if request.is_ajax():
if not request.user or not request.user.is_authenticated():
if not request.user or not request.user.is_authenticated:
return json_view(lambda *a, **kw: {'error': 'not logged in'})(request, status=403)
return func(request, *args, **kwargs)
else:
Expand All @@ -37,8 +38,7 @@ def wrap(request, *args, **kwargs):
obj = func(request, *args, **kwargs)
data = json.dumps(obj, ensure_ascii=False)
status = kwargs.get('status', 200)
response = HttpResponse(mimetype='application/json', status=status)
response = HttpResponse(content_type='application/json', status=status)
response.write(data)
return response
return wrap

Loading