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

migrate to poetry #3

Merged
merged 6 commits into from
Jul 2, 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
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