diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..048ee8d --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,103 @@ +name: Run Python Tests +on: push + +jobs: + build-macos: + strategy: + matrix: + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + runs-on: "macos-latest" + steps: + - name: Install md5sha1sum + run: brew install md5sha1sum + - uses: actions/checkout@v3 + with: + python-version: ${{ matrix.python-version }} + - name: Install Python + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install Poetry + uses: snok/install-poetry@v1 + with: + version: 1.5.1 + virtualenvs-in-project: true + - name: Install dependencies + run: poetry install --no-interaction --no-root + - name: Install library + run: poetry install --no-interaction + - name: Run tests + run: poetry run make tests + - uses: psf/black@stable + with: + options: "--check --verbose" + src: "./" + version: "23.3" + - uses: isort/isort-action@v1 + build-linux: + strategy: + matrix: + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + runs-on: "ubuntu-latest" + steps: + - name: Install libxml2 + run: | + sudo apt-get update + sudo apt-get install libxml2 libxml2-dev libxslt1-dev + - uses: actions/checkout@v3 + with: + python-version: ${{ matrix.python-version }} + - name: Install Python + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install Poetry + uses: snok/install-poetry@v1 + with: + version: 1.5.1 + virtualenvs-in-project: true + - name: Install dependencies + run: poetry install --no-interaction --no-root + - name: Install library + run: poetry install --no-interaction + - name: Run tests + run: poetry run make tests + - uses: psf/black@stable + with: + options: "--check --verbose" + src: "./" + version: "23.3" + - uses: isort/isort-action@v1 + build-windows: + strategy: + matrix: + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + runs-on: "windows-latest" + defaults: + run: + shell: bash + steps: + - uses: actions/checkout@v3 + with: + python-version: ${{ matrix.python-version }} + - name: Install Python + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install Poetry + uses: snok/install-poetry@v1 + with: + version: 1.5.1 + virtualenvs-in-project: true + - name: Install dependencies + run: poetry install --no-interaction --no-root + - name: Install library + run: poetry install --no-interaction + - name: Run tests + run: poetry run make tests + - uses: psf/black@stable + with: + options: "--check --verbose" + src: "./" + version: "23.3" + # - uses: isort/isort-action@v1 diff --git a/.gitignore b/.gitignore index 7f90a96..1a4195c 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,5 @@ mf2py.egg-info/ nbproject/ venv/ *~ +poetry.lock +site/ diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index e69de29..0000000 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 4e942d3..0000000 --- a/.travis.yml +++ /dev/null @@ -1,14 +0,0 @@ -language: python -python: - - "2.7" - - "3.3" - - "3.4" - - "3.5" - - "3.6" - - "pypy" - - "pypy3" -sudo: false -# command to install dependencies -install: "pip install -r requirements.txt" -# command to run tests -script: nosetests --exclude=test_suite diff --git a/AUTHORS b/AUTHORS deleted file mode 100644 index 3e99d23..0000000 --- a/AUTHORS +++ /dev/null @@ -1,5 +0,0 @@ -Tom Morris http://tommorris.org/ -Barnaby Walters http://waterpigs.co.uk -Kartik Prabhu https://kartikprabhu.com -Kyle Mahan https://kylewm.com -Kevin Marks http://www.kevinmarks.com/ diff --git a/CHANGELOG.md b/CHANGELOG.md index b78ecc8..1d4404b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,48 @@ # Change Log All notable changes to this project will be documented in this file. +## 2.0.1 - 2023-12-07 +The mf2py library is excited to transition into 2.0. This version increase incorporates months of work from contributors, informed by active discussions among implementers and users. + +This release officially deprecates support for versions of Python lower than 3.8. + +Below are the changes we have made in this release. + +### New Features +- Enable `img_with_alt` by default (#184) +- Add timezone offset normalisation (#206) +- Add option for exposing DOM for embedded properties (#208) +- Add srcset support (#209) +- Add language support (#210) +- Add option for filtering root class names (#211) +- Add option for metaformats support (#213) + +### Changes +- Remove `img_with_alt` option entirely (#200) +- Resolve implied photo relative paths (#205) +- Make relative URLs in embedded properties absolute (#201) +- Fix whitespace in plaintext conversion (#207) +- Replace `dict_class` with standard `dict` (#196) + +### Tests, Library and Documentation Maintenance +- Update tests to include alt texts by default (#190) +- Add Windows and macOS tests (#198) +- Use poetry for dependency management (#189) +- Deprecate Python 2 support (#179) +- Lint code with `black` and `isort` +- Add linting CI actions (#193) +- Move from `nosetests` to `pytest` (#186) +- Add 3.11, 3.12 and drop pypy from test matrix; upgrade poetry action (#204) +- Prepare tests to test options (#214) +- Bring README doctests up-to-date (#215) + +## 1.1.3 - 2022-06-28 +- reduce instances where photo is implied (#135) +- always do relative URL resolution (#138) +- VCP now handles tz offsets without leading zeros (#142) +- implement id parsing (#143) +- fix outdated syntax causing SyntaxWarning (#157) + ## 1.1.2 - 2018-08-08 - add parsing for iframe.u-*[src] (#116) - bug fix: reduced implied urls (#117) @@ -10,9 +52,8 @@ All notable changes to this project will be documented in this file. - misc performance improvements ## 1.1.1 - 2018-06-15 - - streamline backcompat to use JSON only. -- fix multiple mf1 root rel-tag parsing +- fix multiple mf1 root rel-tag parsing - correct url and photo for hreview. - add rules for nested hreview. update backcompat to use multiple matches in old properties. - fix `rel-tag` to `p-category` conversion so that other classes are not lost. @@ -22,16 +63,15 @@ All notable changes to this project will be documented in this file. - fix `parse` method to use default html parser. - always use the first value for attributes for rels. - correct AM/PM conversion in datetime value class pattern. - - add ordinal date parsing to datetimes value class pattern. ordinal date is normalised to YYYY-MM-DD +- add ordinal date parsing to datetimes value class pattern. ordinal date is normalised to YYYY-MM-DD - remove hack for html tag classes since that is fixed in new BS - better whitespace algorithm for `name` and `html.value` parsing - experimental flag for including `alt` in `u-photo` parsing - make a copy of the BeautifulSoup given by user to work on for parsing to prevent changes to original doc -- bump version to 1.1.1 +- bump version to 1.1.1 ## 1.1.0 - 2018-03-16 - -- bump version to 1.1.0 since it is a "major" change +- bump version to 1.1.0 since it is a "major" change - added tests for new implied name rules - modified earlier tests to accommodate new rules - use space separator instead of "T" @@ -44,22 +84,20 @@ All notable changes to this project will be documented in this file. - reorganise tests - remove Heroku frontend, point to mf2py-web and python.microformats.io instead in README. - remove Flask and gunicorn requirements -- add debug info with description, version, url and the html parser used +- add debug info with description, version, url and the html parser used ## 1.0.6 - 2018-03-04 - - strip leading/trailing white space for `e-*[html]`. update the corresponding tests -- blank values explicitly authored are allowed as property values +- blank values explicitly authored are allowed as property values - include `alt` or `src` from `` in parsing for `p-*` and `e-*[value]` -- parse `title` from `` for `p-*` resolves #84 -- and `poster` from `