Skip to content

Commit

Permalink
migrate to poetry (#3)
Browse files Browse the repository at this point in the history
* migrate to poetry

* move poetry install first

* update lockfile

* fix script declaration

* update docs

* bump workflow versions
  • Loading branch information
freddyheppell authored Jul 2, 2024
1 parent 4dac00a commit 4ad44e2
Show file tree
Hide file tree
Showing 10 changed files with 1,121 additions and 613 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Lint

on:
push:
branches: ["main"]
branches: ["main", "dev"]
pull_request:
branches: ["main"]
branches: ["main", "dev"]

permissions:
contents: read
Expand All @@ -14,19 +14,19 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install Poetry
run: pipx install poetry==1.8.3
- name: Set up Python 3.8
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: "3.8"
cache: "pipenv"
- name: Install Pipenv
run: python -m pip install --upgrade pipenv wheel
cache: "poetry"
- name: Install Python dependencies
run: pipenv install --deploy --dev
run: poetry install --no-interaction --no-root
- name: Install Project
run: poetry install --no-interaction
- name: Lint with Black
run: pipenv run black --check .
run: poetry run black --check .
- name: Lint with Flake8
run: pipenv run flake8 .
- name: Tests
run: pipenv run pytest
run: poetry run flake8 .
23 changes: 11 additions & 12 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Test

on:
push:
branches: ["main"]
branches: ["main", "dev"]
pull_request:
branches: ["main"]
branches: ["main", "dev"]

permissions:
contents: read
Expand All @@ -14,18 +14,17 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install Poetry
run: pipx install poetry==1.8.3
- name: Set up Python 3.8
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: "3.8"
cache: "pipenv"
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Install Pipenv
run: python -m pip install --upgrade pipenv wheel
cache: "poetry"
- name: Install Python dependencies
run: pipenv install --deploy --dev
run: poetry install --no-interaction --no-root
- name: Install Project
run: poetry install --no-interaction
- name: Run tests
run: pipenv run pytest
run: poetry run pytest
29 changes: 0 additions & 29 deletions Pipfile

This file was deleted.

514 changes: 0 additions & 514 deletions Pipfile.lock

This file was deleted.

18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,22 +39,24 @@ If you use this tool in published work, please cite [our EMNLP paper](https://ac

## Installing

1. Download and extract the project
2. Create a virtual environment (with `venv`, `Pipenv` or a similar tool)
3. Run `python setup.py` to install the package and dependencies
4. Check it has installed with `wpextract --help`
WordPress Site Extractor is currently not available from PyPI, but can instead be installed from a prebuilt wheel.

1. Go to the [latest release](https://github.com/GateNLP/wordpress-site-extractor/releases/latest) and download the `.whl` file
2. Create a new Python 3.8 virtual environment
3. Install the package with `pip install /path/to/wp_site_extractor-x.y.z-py3-none-any.whl`
4. Run with the `wpextract` command

### Installing Development Environment

**Prerequisites**:

- Python 3.8
- Pipenv
- [Poetry](https://python-poetry.org/)

1. Clone the repository
2. Run `pipenv install --dev`
- You may need to add the argument `--python path/to/bin/python` if Python 3.8 is not on your path
3. Run the CLI with the `wpextract-dev` helper
2. Run `poetry install`
- You may need to first run `poetry env use /path/to/python` if Python 3.8 is not on your path
3. Run the CLI with `poetry run wpextract`

## Input Format

Expand Down
Loading

0 comments on commit 4ad44e2

Please sign in to comment.