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

refactor: repo maintenance #70

Merged
merged 9 commits into from
Jan 18, 2024
Merged
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
44 changes: 30 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,42 @@
name: CI
on: [push]
name: Python CI

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

concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true

jobs:
python-tests:
runs-on: ubuntu-latest
tests:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-20.04 ]
python-version: [ '3.8' ]
toxenv: [django32, django42, quality]
python-version: [3.8]
toxenv: [django32, django42, quality, package]
steps:
- name: Install system requirements
- name: Install translations dependencies
run: sudo apt-get install -y gettext
- uses: actions/checkout@v2
continue-on-error: true
- name: Python setup
uses: actions/setup-python@v2

- name: checkout repo
uses: actions/checkout@v3
with:
submodules: recursive

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

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

- name: Run Tests
env:
Expand Down
13 changes: 5 additions & 8 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,30 @@
name: pypi-publish
name: Publish package to PyPI

on:
release:
types: [published]

jobs:
publish-package:
push:
runs-on: ubuntu-20.04

steps:
- name: Checkout
uses: actions/checkout@v3

- name: setup python
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: 3.8

- name: Install pip
run: pip install pip

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

- name: Build package
run: python setup.py sdist bdist_wheel

- name: Publish to PyPi
uses: pypa/gh-action-pypi-publish@master
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_UPLOAD_TOKEN }}
29 changes: 29 additions & 0 deletions .github/workflows/upgrade-python-requirements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Upgrade Python Requirements

on:
schedule:
- cron: "0 0 * * 1"
workflow_dispatch:
inputs:
branch:
description: Target branch against which to create requirements PR
required: true
default: master

jobs:
call-upgrade-python-requirements-workflow:
uses: openedx/.github/.github/workflows/upgrade-python-requirements.yml@master
# Do not run on forks
if: github.repository_owner == 'openedx'
with:
branch: ${{ github.event.inputs.branch || 'master' }}
# optional parameters below; fill in if you'd like github or email notifications
# user_reviewers: ""
# team_reviewers: ""
# email_address: ""
# send_success_notification: false
secrets:
requirements_bot_github_token: ${{ secrets.REQUIREMENTS_BOT_GITHUB_TOKEN }}
requirements_bot_github_email: ${{ secrets.REQUIREMENTS_BOT_GITHUB_EMAIL }}
edx_smtp_username: ${{ secrets.EDX_SMTP_USERNAME }}
edx_smtp_password: ${{ secrets.EDX_SMTP_PASSWORD }}
63 changes: 51 additions & 12 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,21 +1,42 @@
var/
xblock_google_drive.egg-info
*.log
*.pyc
*~
venv/*
*.py[cod]
__pycache__

# C extensions
*.so

# Packages
*.egg
*.egg-info
dist
build
eggs
parts
bin
var
sdist
env
venv
develop-eggs
.installed.cfg
lib
lib64

# Installer logs
pip-log.txt

# Unit test / coverage reports
.cache/
.pytest_cache/
.coverage
.coverage.*
.pytest_cache
.tox
coverage.xml
htmlcov/
diff-cover.html
pii_report

# Translations
*.pot
*.mo

# IDEs and text editors
*~
Expand All @@ -24,8 +45,26 @@ htmlcov/
.project
.pycharm_helpers/
.pydevproject
.DS_Store

# Build and dist related files
build/
dist/
# The Silver Searcher
.agignore

# OS X artifacts
*.DS_Store

# Logging
log/
logs/
chromedriver.log
ghostdriver.log

# Complexity
output/*.html
output/*/index.html

# Sphinx
docs/_build

# Cookiecutter
output/
dj-package/
4 changes: 4 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
include LICENSE
include README.rst
include requirements/base.in
include requirements/constraints.txt
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,9 @@ upgrade: $(COMMON_CONSTRAINTS_TXT)
pip-compile --upgrade --rebuild -o requirements/pip-tools.txt requirements/pip-tools.in
pip install -qr requirements/pip.txt
pip install -qr requirements/pip-tools.txt
pip-compile --upgrade -o requirements/dev.txt requirements/base.in requirements/dev.in requirements/quality.in requirements/test.in requirements/travis.in
pip-compile --upgrade -o requirements/dev.txt requirements/base.in requirements/dev.in requirements/quality.in requirements/test.in
pip-compile --upgrade -o requirements/quality.txt requirements/base.in requirements/quality.in requirements/test.in
pip-compile --upgrade -o requirements/test.txt requirements/base.in requirements/test.in
pip-compile --upgrade -o requirements/travis.txt requirements/travis.in
pip-compile --upgrade -o requirements/ci.txt requirements/ci.in
# Let tox control the Django version for tests
grep -e "^django==" requirements/test.txt > requirements/django.txt
Expand Down
30 changes: 30 additions & 0 deletions catalog-info.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# This file records information about this repo. Its use is described in OEP-55:
# https://open-edx-proposals.readthedocs.io/en/latest/processes/oep-0055-proc-project-maintainers.html

apiVersion: backstage.io/v1alpha1
# (Required) Acceptable Values: Component, Resource, System
# A repo will almost certainly be a Component.
kind: Component
metadata:
name: xblock-google-drive
description: This XBlock allows embedding documents and calendar.
annotations:
# (Optional) Annotation keys and values can be whatever you want.
# We use it in Open edX repos to have a comma-separated list of GitHub user
# names that might be interested in changes to the architecture of this
# component.
openedx.org/component-type: XBlock
openedx.org/arch-interest-groups: ''
spec:

# (Required) This can be a group (`group:<github_group_name>`) or a user (`user:<github_username>`).
# Don't forget the "user:" or "group:" prefix. Groups must be GitHub team
# names in the openedx GitHub organization: https://github.com/orgs/openedx/teams

owner: user:Agrendalath

# (Required) Acceptable Type Values: service, website, library
type: library

# (Required) Acceptable Lifecycle Values: experimental, production, deprecated
lifecycle: production
2 changes: 2 additions & 0 deletions google_drive/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
"""
from .google_docs import GoogleDocumentBlock
from .google_calendar import GoogleCalendarBlock

__version__ = '0.6.0'
44 changes: 26 additions & 18 deletions requirements/ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,21 @@
#
asgiref==3.7.2
# via django
certifi==2023.7.22
cachetools==5.3.2
# via tox
certifi==2023.11.17
# via requests
chardet==5.2.0
# via tox
charset-normalizer==3.3.2
# via requests
colorama==0.4.6
# via tox
coverage==6.5.0
# via coveralls
coveralls==3.3.1
# via -r requirements/ci.in
distlib==0.3.7
distlib==0.3.8
# via virtualenv
django==3.2.23
# via
Expand All @@ -29,41 +35,43 @@ filelock==3.13.1
# via
# tox
# virtualenv
idna==3.4
idna==3.6
# via requests
lxml==4.9.3
lxml==5.1.0
# via edx-i18n-tools
packaging==23.2
# via tox
path==16.7.1
# via
# pyproject-api
# tox
path==16.9.0
# via edx-i18n-tools
platformdirs==3.11.0
# via virtualenv
platformdirs==4.1.0
# via
# tox
# virtualenv
pluggy==1.3.0
# via tox
polib==1.2.0
# via edx-i18n-tools
py==1.11.0
pyproject-api==1.6.1
# via tox
pytz==2023.3.post1
# via django
pyyaml==6.0.1
# via edx-i18n-tools
requests==2.31.0
# via coveralls
six==1.16.0
# via tox
sqlparse==0.4.4
# via django
tomli==2.0.1
# via tox
tox==3.28.0
# via
# -c requirements/common_constraints.txt
# -r requirements/ci.in
typing-extensions==4.8.0
# pyproject-api
# tox
tox==4.12.0
# via -r requirements/ci.in
typing-extensions==4.9.0
# via asgiref
urllib3==2.0.7
urllib3==2.1.0
# via requests
virtualenv==20.24.6
virtualenv==20.25.0
# via tox
4 changes: 0 additions & 4 deletions requirements/common_constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,3 @@ elasticsearch<7.14.0

# django-simple-history>3.0.0 adds indexing and causes a lot of migrations to be affected
django-simple-history==3.0.0

# tox>4.0.0 isn't yet compatible with many tox plugins, causing CI failures in almost all repos.
# Details can be found in this discussion: https://github.com/tox-dev/tox/discussions/1810
tox<4.0.0
Loading