Skip to content

Commit 068ad3a

Browse files
committed
merge from main tip. This should fix test failure in Markdown2TestCase.test_string_markdown_code_block_attribute by merging html diff method used in tests.
2 parents 146029f + 64e2116 commit 068ad3a

File tree

137 files changed

+15317
-8488
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

137 files changed

+15317
-8488
lines changed

.github/workflows/anchore.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
6+
# This workflow checks out code, builds an image, performs a container image
7+
# vulnerability scan with Anchore's Grype tool, and integrates the results with GitHub Advanced Security
8+
# code scanning feature. For more information on the Anchore scan action usage
9+
# and parameters, see https://github.com/anchore/scan-action. For more
10+
# information on Anchore's container image scanning tool Grype, see
11+
# https://github.com/anchore/grype
12+
name: Anchore Container Scan
13+
14+
on:
15+
push:
16+
branches: [ "master" ]
17+
pull_request:
18+
# The branches below must be a subset of the branches above
19+
branches: [ "master" ]
20+
schedule:
21+
- cron: '38 21 * * 6'
22+
23+
permissions:
24+
contents: read
25+
26+
concurrency:
27+
group: ${{ github.workflow }}-${{ github.ref }}
28+
cancel-in-progress: true
29+
30+
jobs:
31+
Anchore-Build-Scan:
32+
permissions:
33+
contents: read # for actions/checkout to fetch code
34+
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
35+
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
36+
runs-on: ubuntu-latest
37+
steps:
38+
- name: Checkout the code
39+
uses: actions/checkout@v3
40+
- name: Build the Docker image
41+
run: docker build . --file scripts/Docker/Dockerfile --tag localbuild/testimage:latest
42+
- name: Run the Anchore scan action itself with GitHub Advanced Security code scanning integration enabled
43+
uses: anchore/scan-action@v3
44+
id: scan
45+
with:
46+
image: "localbuild/testimage:latest"
47+
acs-report-enable: true
48+
fail-build: false
49+
- name: Upload Anchore Scan Report
50+
uses: github/codeql-action/upload-sarif@v2
51+
with:
52+
sarif_file: ${{ steps.scan.outputs.sarif }}
53+
- name: Inspect action SARIF report
54+
run: cat ${{ steps.scan.outputs.sarif }}

.github/workflows/ci-test.yml

Lines changed: 259 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,259 @@
1+
# merged in python-package.yml workflow
2+
3+
name: roundup-ci
4+
5+
on:
6+
push:
7+
# skip if github.ref is 'refs/heads/maint-1.6'
8+
# aka github.ref_name of 'maint-1.6'
9+
# see https://github.com/orgs/community/discussions/26253
10+
# for mechanism to control matrix based on branch
11+
branches: [ "*", '!maint-1.6' ]
12+
# pull_request:
13+
# branches: [ "master" ]
14+
schedule:
15+
# monthly build/check
16+
- cron: '23 17 1 * *'
17+
18+
# GITHUB_TOKEN only has read repo context.
19+
permissions:
20+
contents: read
21+
22+
concurrency:
23+
group: ${{ github.workflow }}-${{ github.ref }}
24+
cancel-in-progress: true
25+
26+
jobs:
27+
test:
28+
name: CI build test
29+
30+
# run the finalizer for coveralls even if one or more
31+
# matrix runs fail.
32+
continue-on-error: true
33+
34+
#runs-on: ubuntu-latest
35+
# use below if running on multiple OS's.
36+
runs-on: ${{ matrix.os }}
37+
38+
strategy:
39+
fail-fast: false
40+
max-parallel: 4
41+
matrix:
42+
# Run in all these versions of Python
43+
python-version: [ "2.7", "3.10", "3.9", "3.8", "3.6", "3.11-dev" ]
44+
45+
# use for multiple os or ubuntu versions
46+
#os: [ubuntu-latest, macos-latest, windows-latest]
47+
os: [ubuntu-latest, ubuntu-22.04]
48+
49+
# if the ones above fail. fail the build
50+
experimental: [false]
51+
52+
include:
53+
# example: if 3.12 fails the jobs still succeeds
54+
# - python-version: 3.12
55+
# experimental: [true]
56+
# version 2.7 not available on unbuntu-22.04 github
57+
# - python-version: 2.7
58+
# os: ubuntu-22.04
59+
# experimental: true
60+
- python-version: 3.11-dev
61+
os: ubuntu-22.04
62+
experimental: [true]
63+
64+
exclude:
65+
# skip all python versions on 22.04 except explicitly included
66+
- os: ubuntu-22.04
67+
68+
env:
69+
# get colorized pytest output even without a controlling tty
70+
PYTEST_ADDOPTS: "--color=yes"
71+
# OS: ${{ matrix.os }}
72+
PYTHON_VERSION: ${{ matrix.python-version }}
73+
74+
steps:
75+
# Checkout the latest code from the repo
76+
- name: Checkout source
77+
# example directives:
78+
# disable step
79+
# if: {{ false }}
80+
# continue running if step fails
81+
# continue-on-error: true
82+
uses: actions/checkout@v3
83+
84+
# Setup version of Python to use
85+
- name: Set Up Python ${{ matrix.python-version }}
86+
uses: actions/setup-python@v4
87+
with:
88+
python-version: ${{ matrix.python-version }}
89+
cache: 'pip'
90+
91+
# Display the Python version being used
92+
- name: Display Python and key module versions
93+
run: |
94+
python -c "import sys; print('python version: ', sys.version)"
95+
python -c "import sqlite3; print('sqlite3 version, sqlite version: ', sqlite3.version, sqlite3.sqlite_version)"
96+
97+
# Install the databases
98+
- name: Install mysql/mariadb
99+
run: |
100+
#set -xv
101+
# mysql is pre-installed and active but this is the install command
102+
# sudo apt-get install mysql-server mysql-client
103+
# set up mysql database
104+
sudo sed -i -e '/^\[mysqld\]/,/^\[mysql/s/^#* *max_allowed_packet.*/max_allowed_packet = 500M/' /etc/mysql/mysql.conf.d/mysqld.cnf; sleep 3
105+
#tail -n +0 /etc/mysql/my.cnf /etc/mysql/mysql.conf.d/mysqld.cnf
106+
#grep max_allowed /etc/mysql/mysql.conf.d/mysqld.cnf
107+
#ls /etc/mysql/conf.d/ /etc/mysql/mysql.conf.d/
108+
#sleep 5
109+
sudo service mysql restart
110+
#sleep 10
111+
#ps -ef | grep mysqld
112+
#sudo netstat -anp | grep mysqld
113+
sudo mysql -u root -proot -e 'CREATE USER "rounduptest"@"localhost" IDENTIFIED WITH mysql_native_password BY "rounduptest"; GRANT ALL on rounduptest.* TO "rounduptest"@"localhost";'
114+
115+
- name: Install postgres
116+
run: |
117+
sudo apt-get install postgresql
118+
# Disable fsync for speed, don't care about data durability
119+
# when testing
120+
sudo sed -i -e '$a\fsync = off' /etc/postgresql/*/*/postgresql.conf
121+
sudo service postgresql restart; sleep 10
122+
# set up postgresql database
123+
sudo -u postgres psql -c "CREATE ROLE rounduptest WITH CREATEDB LOGIN PASSWORD 'rounduptest';" -U postgres
124+
125+
- name: install redis
126+
run: |
127+
sudo apt-get install redis
128+
pip install redis
129+
130+
- name: Update pip
131+
run: python -m pip install --upgrade pip
132+
133+
- name: Install python db libraries
134+
run: pip install psycopg2 mysqlclient
135+
136+
- name: Install auxiliary packages
137+
run: |
138+
sudo apt-get install swig gpgsm libgpgme-dev
139+
# pygments for markdown2 to highlight code blocks
140+
pip install markdown2 pygments
141+
# docutils for ReStructuredText
142+
pip install beautifulsoup4 brotli docutils gpg jinja2 \
143+
mistune==0.8.4 pyjwt pytz whoosh
144+
145+
- name: Install aux packages that need versions differences
146+
# if zstd fails install, keep going with test, don't abort
147+
run: |
148+
set -xv
149+
pip install zstd || true
150+
if [[ "$PYTHON_VERSION" != "2."* ]]; then
151+
pip install Markdown; fi
152+
153+
- name: Install xapian
154+
run: |
155+
sudo apt-get install libxapian-dev
156+
# Sphinx required to build the xapian python bindings. Use 1.8.5 on
157+
# older python and newest on newer.
158+
if [[ $PYTHON_VERSION == "2."* ]]; then pip install sphinx==1.8.5; fi
159+
if [[ $PYTHON_VERSION == '3.'* ]] ; then pip install sphinx; fi
160+
XAPIAN_VER=$(dpkg -l libxapian-dev | tail -n 1 | awk '{print $3}' | cut -d '-' -f 1); echo $XAPIAN_VER
161+
cd /tmp
162+
curl -s -O https://oligarchy.co.uk/xapian/$XAPIAN_VER/xapian-bindings-$XAPIAN_VER.tar.xz
163+
tar -Jxvf xapian-bindings-$XAPIAN_VER.tar.xz
164+
cd xapian-bindings-$XAPIAN_VER/
165+
if [[ $PYTHON_VERSION == "2."* ]]; then ./configure --prefix=$VIRTUAL_ENV --with-python --disable-documentation; fi
166+
# edit the configure script.
167+
# distutils.sysconfig.get_config_vars('SO') doesn't work for
168+
# 3.11 or newer.
169+
# Change distutils.sysconfig... to just sysconfig and SO
170+
# to EXT_SUFFIX to get valid value.
171+
if [[ $PYTHON_VERSION == "3."* ]]; then sed -i -e '/PYTHON3_SO=/s/distutils\.//g' -e '/PYTHON3_SO=/s/"SO"/"EXT_SUFFIX"/g' configure; ./configure --prefix=$VIRTUAL_ENV --with-python3 --disable-documentation; fi
172+
case "$PYTHON_VERSION" in nightly) echo skipping xapian build;; *) make && sudo make install; esac
173+
174+
- name: Install pytest and other packages needed for running tests
175+
run: pip install codecov flake8 mock pytest pytest-cov requests
176+
177+
- name: Test build roundup and install locale so lang tests work.
178+
run: |
179+
sudo apt-get install gettext
180+
python setup.py build
181+
(cd locale; make local_install; ls -lR locale/de/LC_MESSAGES)
182+
183+
- name: run flake8 - abort for syntax error, otherwise warn only
184+
run: |
185+
# stop the build for Python syntax errors or undefined names
186+
# talgettext is a utility function ignore it.
187+
flake8 roundup --count --select=E9,F63,F7,F82 --show-source --statistics --extend-exclude talgettext.py
188+
# exit-zero treats all errors as warnings.
189+
# The GitHub editor is 127 chars wide
190+
flake8 roundup --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
191+
192+
# Run the tests using pytest with test files in tests directory.
193+
- name: Run tests
194+
run: |
195+
if [[ "$PYTHON_VERSION" != "2."* ]]; then
196+
pytest -r a \
197+
-W default \
198+
-W "ignore:SelectableGroups:DeprecationWarning" \
199+
-W "ignore:the imp module:DeprecationWarning:gpg.gpgme:15" \
200+
-W "ignore:'U' mode::docutils.io" \
201+
-W "ignore:unclosed:ResourceWarning:roundup.roundup.demo" \
202+
-W "ignore:unclosed file:ResourceWarning:enum" \
203+
-v test/ --cov=roundup
204+
if [[ "$PYTHON_VERSION" != "3.6" ]]; then
205+
# coverage before 3.6 doesn't support lcov output
206+
coverage lcov
207+
fi
208+
else
209+
# python2 case
210+
pytest -v -r a test/ --cov=roundup
211+
fi
212+
213+
- name: Upload coverage to Codecov
214+
# see: https://github.com/codecov/codecov-action#usage
215+
uses: codecov/codecov-action@v3
216+
with:
217+
verbose: true
218+
token: ${{ secrets.CODECOV_TOKEN }}
219+
220+
- name: Upload coverage to Coveralls
221+
# python 2.7 and 3.6 versions of coverage can't produce lcov files.
222+
if: matrix.python-version != '2.7' && matrix.python-version != '3.6'
223+
uses: coverallsapp/github-action@master
224+
with:
225+
github-token: ${{ secrets.GITHUB_TOKEN }}
226+
path-to-lcov: coverage.lcov
227+
parallel: run-{{ matrix.python-version }}-{{ matrix.os }}
228+
229+
- name: test build_doc
230+
run: |
231+
python ./setup.py build_doc
232+
233+
#- name: test docker build current version ubuntu-latest
234+
# if: matrix.python-version == '3.10' && matrix.os == 'ubuntu-latest'
235+
# run: |
236+
# docker build -t roundup-app-dev -f scripts/Docker/Dockerfile .
237+
# mkdir tracker; chmod 777 tracker
238+
# docker run -d --rm -p 9017:8080 \
239+
# -v $PWD/tracker:/usr/src/app/tracker \
240+
# roundup-app-dev:latest demo
241+
# expect 200
242+
# curl --fail http://localhost:9017/demo/ > /dev/null
243+
244+
#- name: test docker build released pip version
245+
# run: |
246+
# docker build -t roundup-app-rel --build-arg="source=pypi" \
247+
# -f scripts/Docker/Dockerfile .
248+
249+
250+
# in parallel build codecov requires a finish step
251+
finish:
252+
needs: test
253+
runs-on: ubuntu-latest
254+
steps:
255+
- name: Coveralls Finished
256+
uses: coverallsapp/github-action@master
257+
with:
258+
github-token: ${{ secrets.github_token }}
259+
parallel-finished: true

.github/workflows/codeql-analysis.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ on:
2121
schedule:
2222
- cron: '28 17 * * 1'
2323

24+
concurrency:
25+
group: ${{ github.workflow }}-${{ github.ref }}
26+
cancel-in-progress: true
27+
2428
jobs:
2529
analyze:
2630
name: Analyze
@@ -40,7 +44,7 @@ jobs:
4044

4145
# Initializes the CodeQL tools for scanning.
4246
- name: Initialize CodeQL
43-
uses: github/codeql-action/init@v1
47+
uses: github/codeql-action/init@v2
4448
with:
4549
languages: ${{ matrix.language }}
4650
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -51,7 +55,7 @@ jobs:
5155
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5256
# If this step fails, then you should remove it and run the build manually (see below)
5357
- name: Autobuild
54-
uses: github/codeql-action/autobuild@v1
58+
uses: github/codeql-action/autobuild@v2
5559

5660
# ℹ️ Command-line programs to run using the OS shell.
5761
# 📚 https://git.io/JvXDl
@@ -65,4 +69,4 @@ jobs:
6569
# make release
6670

6771
- name: Perform CodeQL Analysis
68-
uses: github/codeql-action/analyze@v1
72+
uses: github/codeql-action/analyze@v2

.hgignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,4 @@ website/www/_tmp/
4646
website/www/COPYING.txt
4747
website/www/docs
4848
website/www/html/
49+
.pytest_cache

.hgtags

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,3 +135,9 @@ ff92cc5d9359ee6c83e1a8338b363a9aa421d64c 2.0.0beta0
135135
0000000000000000000000000000000000000000 2.1.0b1
136136
013a2e3da452a5dcc05e15f4a03667a8d4bc0870 2.1.0b1
137137
cbc18a8bc61f120fc27df2a90d7c922b12bf9014 2.1.0
138+
b3ba03d2b214ce598d3a181f3b43b46c3406713f 2.2.0b1
139+
c90104abe508e3886917243e4acd069c8ef7a1a4 2.2.0
140+
c90104abe508e3886917243e4acd069c8ef7a1a4 2.2.0
141+
0000000000000000000000000000000000000000 2.2.0
142+
0000000000000000000000000000000000000000 2.2.0
143+
239d9542b02062c56f88fd1de8b87c4d88d700ad 2.2.0

0 commit comments

Comments
 (0)