Skip to content

Commit

Permalink
Merge pull request #189 from angelogladding/pypoetry
Browse files Browse the repository at this point in the history
Use poetry for dependency management
  • Loading branch information
capjamesg authored Jun 29, 2023
2 parents b29c110 + b8fbad3 commit cde4553
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 60 deletions.
22 changes: 12 additions & 10 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ jobs:
build:
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]
runs-on: ubuntu-20.04
python-version: ["3.8", "3.9", "3.10", "pypy3.8", "pypy3.9"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -25,12 +25,14 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.2.2
virtualenvs-in-project: true
- name: Install dependencies
run: |
python -m venv env
source env/bin/activate
pip install -r requirements.txt
- name: Run tests with pytest
run: |
source env/bin/activate
pytest
run: poetry install --no-interaction --no-root
- name: Install library
run: poetry install --no-interaction
- name: Run tests
run: poetry run pytest
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ mf2py.egg-info/
nbproject/
venv/
*~
poetry.lock
4 changes: 3 additions & 1 deletion mf2py/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
# the value without loading mf2py (loading mf2py is bad if its dependencies
# haven't been installed yet, which is common during setup)

__version__ = '2.0.0'
import importlib.metadata

__version__ = importlib.metadata.metadata("mf2py")["Version"]
27 changes: 27 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[tool.poetry]
name = "mf2py"
version = "1.1.3"
description = "Microformats parser"
authors = ["Tom Morris <tom@tommorris.org>"]
license = "MIT"
classifiers = [
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Topic :: Text Processing :: Markup :: HTML"
]

[tool.poetry.dependencies]
python = ">=3.8"
html5lib = "^1.1"
requests = "^2.28.2"
beautifulsoup4 = "^4.11.1"

[tool.poetry.group.dev.dependencies]
lxml = "^4.9.2"
mock = "^5.0.1"
pytest = "^7.2.1"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
8 changes: 0 additions & 8 deletions requirements.txt

This file was deleted.

41 changes: 0 additions & 41 deletions setup.py

This file was deleted.

0 comments on commit cde4553

Please # to comment.