-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
breaking: Deploy to PyPi instead of the executable
- Loading branch information
Showing
6 changed files
with
161 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,16 +14,10 @@ on: | |
- hotfix/* | ||
- main | ||
|
||
env: | ||
# See: https://github.com/upx/upx/releases | ||
UPX_VERSION: "4.2.4" | ||
|
||
jobs: | ||
init: | ||
name: Init | ||
runs-on: ubuntu-22.04 | ||
permissions: | ||
contents: read | ||
runs-on: ubuntu-24.04 | ||
outputs: | ||
VERSION: ${{ steps.version.outputs.version }} | ||
VERSION_FULL: ${{ steps.version.outputs.version_full }} | ||
|
@@ -46,8 +40,7 @@ jobs: | |
name: Test | ||
permissions: | ||
id-token: write | ||
contents: read | ||
runs-on: ubuntu-22.04 | ||
runs-on: ubuntu-24.04 | ||
needs: | ||
- init | ||
strategy: | ||
|
@@ -56,6 +49,9 @@ jobs: | |
step: | ||
- test-static | ||
# - test-unit | ||
python-version: | ||
- '3.12' | ||
- '3.13' | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
|
@@ -102,37 +98,17 @@ jobs: | |
name: test-results | ||
path: test-reports/* | ||
|
||
build-app: | ||
name: Build & archive app | ||
permissions: | ||
contents: write | ||
packages: write | ||
build-wheels: | ||
name: Build wheels | ||
runs-on: ${{ matrix.os }} | ||
needs: | ||
- init | ||
- test | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
# TODO: Build for musl (Alpine Linux) | ||
os: | ||
# All versions of macOS supported by GitHub Actions | ||
- macos-12 | ||
- macos-13 | ||
- macos-14 | ||
- macos-15 | ||
# All versions of Ubuntu supported by GitHub Actions | ||
- ubuntu-20.04 | ||
- ubuntu-22.04 | ||
- ubuntu-24.04 | ||
# All versions of Windows supported by GitHub Actions | ||
- windows-2019 | ||
- windows-2022 | ||
os: [ubuntu-24.04, windows-2022, macos-15] | ||
steps: | ||
- name: Configure Git (Windows) | ||
if: runner.os == 'Windows' | ||
run: git config --system core.longpaths true | ||
|
||
- name: Checkout | ||
uses: actions/[email protected] | ||
|
||
|
@@ -142,28 +118,23 @@ jobs: | |
cache: pip | ||
python-version: "3.13" | ||
|
||
- name: Set up QEMU | ||
if: runner.os == 'Linux' | ||
uses: docker/[email protected] | ||
with: | ||
platforms: all | ||
|
||
- name: Set up make (Windows) | ||
if: runner.os == 'Windows' | ||
run: | | ||
choco install make | ||
make --version | ||
- name: Set up UPX (Windows) | ||
if: runner.os == 'Windows' | ||
run: | | ||
choco install upx --version ${{ env.UPX_VERSION }} | ||
upx --version | ||
- name: Set up dependencies | ||
run: | | ||
python3 -m pip install --upgrade pip wheel setuptools | ||
make install-deps | ||
- name: Set up dependencies (Windows) | ||
if: runner.os == 'Windows' | ||
run: | | ||
python3 -m pip install pywin32-ctypes pefile | ||
- name: Write version (Linux) | ||
if: runner.os == 'Linux' || runner.os == 'macOS' | ||
run: echo '__version__ = "${{ needs.init.outputs.VERSION_FULL }}"' > app/__init__.py | ||
|
@@ -175,26 +146,79 @@ jobs: | |
- name: Build to binary | ||
run: make build | ||
|
||
- name: Rename binary (Linux) | ||
if: runner.os == 'Linux' || runner.os == 'macOS' | ||
run: mv dist/scrape-it-now dist/scrape-it-now-${{ needs.init.outputs.VERSION }}-${{ matrix.os }} | ||
|
||
- name: Rename binary (Windows) | ||
if: runner.os == 'Windows' | ||
run: mv dist\scrape-it-now.exe dist\scrape-it-now-${{ needs.init.outputs.VERSION }}-${{ matrix.os }}.exe | ||
|
||
- name: Upload artifacts | ||
uses: actions/[email protected] | ||
with: | ||
compression-level: 9 | ||
name: binary-${{ matrix.os }} | ||
path: dist/* | ||
name: wheels-${{ matrix.os }}-${{ strategy.job-index }} | ||
path: dist/*.whl | ||
|
||
publish-testpypi: | ||
name: Publish to TestPyPI | ||
environment: | ||
name: testpypi | ||
url: https://test.pypi.org/p/scrape-it-now | ||
permissions: | ||
id-token: write | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- name: Download artifacts | ||
uses: actions/[email protected] | ||
with: | ||
merge-multiple: true | ||
path: dist | ||
pattern: wheels-* | ||
|
||
- name: Publish to TestPyPI | ||
uses: pypa/[email protected] | ||
with: | ||
repository-url: https://test.pypi.org/legacy | ||
|
||
publish-pypi: | ||
name: Publish to PyPI | ||
environment: | ||
name: pypi | ||
url: https://pypi.org/p/scrape-it-now | ||
permissions: | ||
id-token: write | ||
runs-on: ubuntu-24.04 | ||
if: github.ref == 'refs/heads/main' | ||
steps: | ||
- name: Download artifacts | ||
uses: actions/[email protected] | ||
with: | ||
merge-multiple: true | ||
path: dist | ||
pattern: wheels-* | ||
|
||
- name: Publish to PyPI | ||
uses: pypa/[email protected] | ||
|
||
attest-binaries: | ||
name: Attest binaries | ||
permissions: | ||
contents: write | ||
id-token: write | ||
runs-on: ubuntu-24.04 | ||
needs: | ||
- build-wheels | ||
steps: | ||
- name: Download artifacts | ||
uses: actions/[email protected] | ||
with: | ||
name: wheels-* | ||
|
||
- name: Generate attestations | ||
uses: actions/[email protected] | ||
with: | ||
subject-path: dist/* | ||
|
||
attest-dependencies: | ||
name: Attest - Dependencies | ||
name: Attest dependencies | ||
permissions: | ||
contents: write | ||
runs-on: ubuntu-22.04 | ||
id-token: write | ||
runs-on: ubuntu-24.04 | ||
needs: | ||
- test | ||
steps: | ||
|
@@ -207,8 +231,8 @@ jobs: | |
directoryExclusionList: docs | ||
|
||
attest-sbom: | ||
name: Attest - SBOM | ||
runs-on: ubuntu-22.04 | ||
name: Attest SBOM | ||
runs-on: ubuntu-24.04 | ||
needs: | ||
- init | ||
- test | ||
|
@@ -233,14 +257,14 @@ jobs: | |
name: Publish release | ||
permissions: | ||
contents: write | ||
runs-on: ubuntu-22.04 | ||
runs-on: ubuntu-24.04 | ||
needs: | ||
- attest-binaries | ||
- attest-dependencies | ||
- attest-sbom | ||
- build-app | ||
- build-wheels | ||
- init | ||
# Only publish on non-scheduled default branch | ||
if: (github.event_name != 'schedule') && (github.ref == 'refs/heads/main') | ||
if: github.ref == 'refs/heads/main' | ||
steps: | ||
- name: Download artifacts | ||
id: download | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,31 @@ | ||
[project] | ||
description = "A website to scrape? There's a simple way." | ||
authors = [ | ||
{name = "Clémence Lesné", email = "[email protected]"} | ||
] | ||
maintainers = [ | ||
{name = "Clémence Lesné", email = "[email protected]"} | ||
] | ||
description = "Web scraper made for AI and simplicity in mind. It runs as a CLI that can be parallelized and outputs high-quality markdown content." | ||
keywords = ["web", "scraper", "markdown", "ai", "parallel", "cli", "automation", "data-extraction", "web-crawling", "content-indexing"] | ||
classifiers = [ | ||
# How mature is the project? | ||
"Development Status :: 4 - Beta", | ||
# For who the project is intended for | ||
"Intended Audience :: Developers", | ||
"Topic :: Internet :: WWW/HTTP :: Dynamic Content :: Content Management System", | ||
"Topic :: Internet :: WWW/HTTP :: Indexing/Search", | ||
"Topic :: System :: Archiving :: Backup", | ||
"Topic :: Text Processing :: Markup :: Markdown", | ||
"Topic :: Utilities", | ||
# Supported Python versions | ||
"Programming Language :: Python :: 3.12", | ||
"Programming Language :: Python :: 3.13", | ||
] | ||
dynamic = ["version"] | ||
license = {file = "LICENSE"} | ||
name = "scrape-it-now" | ||
readme = "README.md" | ||
requires-python = ">=3.13" | ||
requires-python = ">=3.12" | ||
dependencies = [ | ||
"aiodns~=3.2", | ||
"aiofiles~=24.1", | ||
|
@@ -35,6 +56,7 @@ dependencies = [ | |
|
||
[project.optional-dependencies] | ||
dev = [ | ||
"cibuildwheel~=2.21", # Build wheels for all platforms | ||
"deptry~=0.19", # Dependency tree testing | ||
"pip-tools~=7.4", # Compile requirements.txt from pyproject.toml | ||
"pyinstaller~=6.11", # Create standalone executable | ||
|
@@ -46,8 +68,18 @@ dev = [ | |
"ruff~=0.6", # Linter | ||
] | ||
|
||
[project.urls] | ||
Documentation = "https://github.com/clemlesne/scrape-it-now" | ||
Homepage = "https://github.com/clemlesne/scrape-it-now" | ||
Issues = "https://github.com/clemlesne/scrape-it-now/issues" | ||
Repository = "https://github.com/clemlesne/scrape-it-now" | ||
|
||
[project.scripts] | ||
scrape-it-now = "app.app:cli" | ||
scrape-it-now = "app.app:cli_wrapper" | ||
|
||
[build-system] | ||
requires = ["setuptools~=75.3"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[tool.setuptools] | ||
py-modules = [ | ||
|
@@ -75,7 +107,7 @@ DEP002 = [ | |
] | ||
|
||
[tool.ruff] | ||
target-version = "py313" | ||
target-version = "py312" | ||
|
||
[tool.ruff.lint.isort] | ||
combine-as-imports = true | ||
|
@@ -84,4 +116,4 @@ combine-as-imports = true | |
docstring-code-format = true | ||
|
||
[tool.pyright] | ||
pythonVersion = "3.13" | ||
pythonVersion = "3.12" |
Oops, something went wrong.