Skip to content
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
8 changes: 6 additions & 2 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@ jobs:
uses: actions/setup-python@v6
with:
python-version-file: '.python-version'
cache: 'pip'

- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true

- name: Install dependencies
run: pip install -r requirements.txt
run: uv sync

- name: pre-commit
uses: pre-commit/action@v3.0.1
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ this code. Please report unacceptable behavior to admin@ihr.live
1. Make sure that your code is formatted and passed linting according to the project
requirements. This can easily be achieved by installing the `pre-commit` command as
described below.
1. Ensure any new dependencies are added to the `requirements.txt` file.
1. Ensure any new dependencies are added to the `pyproject.toml` file.
1. Add only relevant files to the commit and ignore the rest to keep the repo clean.
- If you add a new dataset / crawler, include a README.md describing the crawler
and the nodes / relationships it will push to the database.
Expand All @@ -42,9 +42,9 @@ git fetch upstream
git merge upstream/main

## Step 3: Setup Virtual Environment and Install Dependencies
python3 -m venv --upgrade-deps .venv
# Requires uv: https://docs.astral.sh/uv/getting-started/installation/
uv sync
source .venv/bin/activate
pip install -r requirements.txt

## Step 4: Setup pre-commit
pre-commit install
Expand Down
3 changes: 2 additions & 1 deletion documentation/crawler-best-practices.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ If you update the ontology (i.e., add a new node and/or relationship type):

If you add a new Python dependency:

- [ ] Update [requirements.txt](../requirements.txt)
- [ ] Update [pyproject.toml](../pyproject.toml) and run `uv lock` to update
[uv.lock](../uv.lock)

## Code considerations

Expand Down
6 changes: 3 additions & 3 deletions documentation/database-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ git clone https://github.com/InternetHealthReport/internet-yellow-pages.git
cd internet-yellow-pages
```

Create Python environment and install Python libraries:
Create the Python environment and install the dependencies. This requires
[uv](https://docs.astral.sh/uv/getting-started/installation/):

```bash
python3 -m venv --upgrade-deps .venv
uv sync
source .venv/bin/activate
pip install -r requirements.txt
```

Create a configuration file from the example file and add API keys. **Note that some
Expand Down
43 changes: 43 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
[project]
name = "internet-yellow-pages"
version = "4.4.0"
description = "The Internet Yellow Pages (IYP) is a knowledge database that gathers information about Internet resources."
readme = "README.md"
license = "GPL-3.0-only"
requires-python = ">=3.12"
dependencies = [
"neo4j",
"iso3166",
"progressbar2",
"arrow",
"tldextract",
"py-radix",
"requests",
"urllib3",
"chardet",
"bs4",
"requests-cache",
"lz4",
"frozendict",
"docker",
"boto3",
"botocore",
"pandas",
"flatdict",
"requests_futures",
"autopep8",
"flake8",
"pre-commit",
"PyGithub",
"clickhouse_driver",
"paramiko",
"scp",
"pyarrow",
"ijson",
]

# This repository is a collection of scripts (crawlers) rather than an installable
# library, so tell uv not to try to build/install it as a package.
[tool.uv]
package = false

27 changes: 0 additions & 27 deletions requirements.txt

This file was deleted.

1,484 changes: 1,484 additions & 0 deletions uv.lock

Large diffs are not rendered by default.

Loading