Skip to content

Commit 8bf65d8

Browse files
Migrate packaging to pyproject.toml
- Removes setup.py file. - Updates pyproject.toml file to include package metadata and deps. - Updates CI/CD config - Requires python 3.8 or higher
1 parent 44ed57f commit 8bf65d8

File tree

6 files changed

+72
-43
lines changed

6 files changed

+72
-43
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
## What's this PR do?
2+
3+
4+
5+
## Why are we doing this?
6+
7+
8+
9+
## Steps to manually test
10+
11+
12+
13+
## Are there any smells or added technical debt to note?
14+

.github/workflows/ci.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,20 @@ jobs:
88
strategy:
99
max-parallel: 2
1010
matrix:
11-
python-version: [3.6, 3.7, 3.8, 3.9]
11+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
1212

1313
steps:
14-
- uses: actions/checkout@v1
14+
- uses: actions/checkout@v4
1515

1616
- name: Set up Python ${{ matrix.python-version }}
17-
uses: actions/setup-python@v1
17+
uses: actions/setup-python@v5
1818
with:
1919
python-version: ${{ matrix.python-version }}
2020

2121
- name: Install dependencies
2222
run: |
2323
python -m pip install --upgrade pip
24-
pip install -r requirements.txt
25-
26-
- run: python setup.py develop
24+
pip install -e .[dev] # installs package in editable mode with dev dependencies
2725
2826
- name: Check imports with isort
2927
run: isort . --check-only

city_scrapers_core/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.10.1"
1+
__version__ = "0.11.0"

pyproject.toml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,55 @@
1+
[build-system]
2+
requires = ["setuptools>=61.0.0", "wheel"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "city-scrapers-core"
7+
description = "Core functionality for City Scrapers projects"
8+
readme = "README.md"
9+
license = { text = "MIT" }
10+
authors = [
11+
{ name = "City Bureau", email = "documenters@citybureau.org" }
12+
]
13+
requires-python = ">=3.8,<4.0"
14+
dependencies = [
15+
"jsonschema>=3.0.0a5",
16+
"pytz",
17+
"requests",
18+
"scrapy"
19+
]
20+
dynamic = ["version"]
21+
classifiers = [
22+
"Development Status :: 4 - Beta",
23+
"Intended Audience :: Developers",
24+
"License :: OSI Approved :: MIT License",
25+
"Programming Language :: Python",
26+
"Programming Language :: Python :: 3",
27+
"Programming Language :: Python :: 3.9",
28+
"Programming Language :: Python :: 3.10",
29+
"Programming Language :: Python :: 3.11",
30+
"Framework :: Scrapy"
31+
]
32+
33+
[project.urls]
34+
homepage = "https://github.com/City-Bureau/city-scrapers-core"
35+
36+
[project.optional-dependencies]
37+
aws = ["boto3"]
38+
azure = ["azure-storage-blob>=12"]
39+
gcs = ["google-cloud-storage"]
40+
dev = [
41+
"pytest",
42+
"black",
43+
"flake8",
44+
"isort",
45+
]
46+
47+
[tool.setuptools.packages.find]
48+
exclude = ["tests"]
49+
50+
[tool.setuptools.dynamic]
51+
version = { attr = "city_scrapers_core.__version__" }
52+
153
[tool.black]
254
exclude = '''
355
/(

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ jsonschema>=3.0.0a5
22
pytz
33
requests
44
scrapy
5-
black==22.6
5+
black
66
flake8
77
pytest
88
isort

setup.py

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)