-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit b00ad76
Showing
23 changed files
with
374 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[tool.bumpversion] | ||
current_version = "0.0.1" | ||
commit = true | ||
tag = true | ||
tag_name = "{new_version}" | ||
|
||
[[tool.bumpversion.files]] | ||
filename = "docs/conf.py" | ||
parse = 'version\s*=\s*"(?P<major>\d+)\.(?P<minor>\d+)' | ||
|
||
[[tool.bumpversion.files]] | ||
filename = "pyproject.toml" | ||
parse = 'version\s*=\s*"(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)' |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[flake8] | ||
ignore = | ||
per-file-ignores = | ||
# D100-D104: Missing docstring | ||
docs/conf.py:D100 | ||
tests/__init__.py:D104 | ||
tests/test_main.py:D100,D103 |
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: publish | ||
on: | ||
push: | ||
tags: | ||
- "[0-9]+.[0-9]+.[0-9]+" | ||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: pypi | ||
url: https://pypi.org/p/form2request | ||
permissions: | ||
id-token: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.12' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install build | ||
- name: Build package | ||
run: python -m build | ||
- name: Publish package | ||
uses: pypa/gh-action-pypi-publish@ec4db0b4ddc65acdf4bff5fa45ac92d78b56bdf0 # 1.9.0 |
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 |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | ||
|
||
name: tox | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
test: | ||
|
||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- python-version: '3.8' | ||
- python-version: '3.9' | ||
- python-version: '3.10' | ||
- python-version: '3.11' | ||
- python-version: '3.12' | ||
- python-version: '3.8' | ||
toxenv: min | ||
- python-version: '3.12' | ||
toxenv: extra | ||
- python-version: '3.8' | ||
toxenv: min-extra | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install tox | ||
- name: tox | ||
run: | | ||
tox -e ${{ matrix.toxenv || 'py' }} | ||
- name: coverage | ||
if: ${{ success() }} | ||
run: bash <(curl -s https://codecov.io/bash) | ||
|
||
check: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ['3.12'] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install tox | ||
python -m pip install pre-commit | ||
- name: tox | ||
run: | | ||
tox -e mypy | ||
tox -e docs | ||
tox -e twinecheck | ||
tox -e linters |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/.coverage | ||
/coverage.xml |
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
repos: | ||
- repo: https://github.com/PyCQA/isort | ||
rev: 5.13.2 | ||
hooks: | ||
- id: isort | ||
- repo: https://github.com/psf/black | ||
rev: 24.4.2 | ||
hooks: | ||
- id: black | ||
- repo: https://github.com/pycqa/flake8 | ||
rev: 7.1.0 | ||
hooks: | ||
- id: flake8 | ||
additional_dependencies: | ||
- flake8-bugbear | ||
- flake8-comprehensions | ||
- flake8-debugger | ||
- flake8-docstrings | ||
- flake8-string-format | ||
- repo: https://github.com/asottile/pyupgrade | ||
rev: v3.16.0 | ||
hooks: | ||
- id: pyupgrade | ||
args: [--py38-plus] |
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
Copyright (c) Zyte Group Ltd | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without modification, | ||
are permitted provided that the following conditions are met: | ||
|
||
1. Redistributions of source code must retain the above copyright notice, | ||
this list of conditions and the following disclaimer. | ||
|
||
2. Redistributions in binary form must reproduce the above copyright | ||
notice, this list of conditions and the following disclaimer in the | ||
documentation and/or other materials provided with the distribution. | ||
|
||
3. Neither the name of Zyte nor the names of its contributors may be used | ||
to endorse or promote products derived from this software without | ||
specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR | ||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
recursive-include tests * |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
============= | ||
Release notes | ||
============= | ||
|
||
… |
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
============ | ||
form2request | ||
============ | ||
|
||
.. image:: https://img.shields.io/pypi/v/form2request.svg | ||
:target: https://pypi.python.org/pypi/form2request | ||
:alt: PyPI Version | ||
|
||
.. image:: https://img.shields.io/pypi/pyversions/form2request.svg | ||
:target: https://pypi.python.org/pypi/form2request | ||
:alt: Supported Python Versions | ||
|
||
.. image:: https://github.com/scrapy/form2request/workflows/test/badge.svg | ||
:target: https://github.com/scrapy/form2request/actions | ||
:alt: Build Status | ||
|
||
.. image:: https://codecov.io/github/scrapy/form2request/coverage.svg?branch=main | ||
:target: https://codecov.io/gh/scrapy/form2request | ||
:alt: Coverage report | ||
|
||
.. description starts | ||
``form2request`` is an AI-powered Python 3.8+ library to build HTTP requests | ||
out of HTML forms. | ||
|
||
.. description ends | ||
* Documentation: https://form2request.readthedocs.io/en/latest/ | ||
* License: BSD 3-clause |
Binary file not shown.
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
============= | ||
API reference | ||
============= | ||
|
||
… |
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
project = "form2request" | ||
copyright = "Zyte Group Ltd" | ||
release = "0.0.0" | ||
|
||
extensions = [ | ||
"sphinx.ext.autodoc", | ||
"sphinx.ext.intersphinx", | ||
] | ||
|
||
html_theme = "sphinx_rtd_theme" | ||
|
||
autodoc_member_order = "groupwise" | ||
|
||
intersphinx_disabled_reftypes = [] | ||
intersphinx_mapping = { | ||
"lxml": ("https://lxml.de/apidoc/", None), | ||
"parsel": ("https://parsel.readthedocs.io/en/stable", None), | ||
"python": ("https://docs.python.org/3", None), | ||
} |
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
==================================== | ||
form2request |release| documentation | ||
==================================== | ||
|
||
.. include:: ../README.rst | ||
:start-after: .. description starts | ||
:end-before: .. description ends | ||
|
||
.. toctree:: | ||
:caption: Getting started | ||
:maxdepth: 1 | ||
|
||
setup | ||
|
||
.. toctree:: | ||
:caption: Usage | ||
:maxdepth: 1 | ||
|
||
usage | ||
|
||
.. toctree:: | ||
:caption: Reference | ||
:maxdepth: 1 | ||
|
||
api | ||
news |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
.. include:: ../NEWS.rst |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Sphinx==7.3.7 | ||
sphinx-rtd-theme==2.0.0 |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
===== | ||
Setup | ||
===== | ||
|
||
Install with pip: | ||
|
||
.. code-block:: bash | ||
pip install form2request |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
===== | ||
Usage | ||
===== | ||
|
||
… |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
"""Build HTTP requests out of HTML forms.""" |
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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
[build-system] | ||
requires = ["setuptools"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
name = "form2request" | ||
version = "0.0.0" | ||
description = "Build HTTP requests out of HTML forms" | ||
authors = [{name = "Zyte Group Ltd", email = "[email protected]"}] | ||
readme = "README.rst" | ||
license = {file = "LICENSE"} | ||
classifiers = [ | ||
"Development Status :: 3 - Alpha", | ||
"Intended Audience :: Developers", | ||
"License :: OSI Approved :: BSD License", | ||
"Natural Language :: English", | ||
"Operating System :: OS Independent", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.12", | ||
] | ||
requires-python = ">=3.8" | ||
dependencies = [ | ||
"lxml >= 4.4.1", | ||
] | ||
|
||
[project.urls] | ||
Code = "https://github.com/zytedata/form2request" | ||
Docs = "https://form2request.readthedocs.io/en/latest/" | ||
|
||
[tool.setuptools.package-data] | ||
form2request = ["py.typed"] | ||
|
||
[tool.isort] | ||
profile = "black" | ||
multi_line_output = 3 | ||
|
||
[[tool.mypy.overrides]] | ||
module = [ | ||
"tests.*", | ||
] | ||
# Allow test functions to be untyped | ||
disallow_untyped_defs = false |
Empty file.
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
def test_main(): | ||
assert True |
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 |
---|---|---|
@@ -0,0 +1,51 @@ | ||
[tox] | ||
envlist = pre-commit,mypy,docs,twinecheck,min,py38,py39,py310,py311,py312 | ||
|
||
[testenv] | ||
deps = | ||
pytest | ||
pytest-cov | ||
commands = | ||
pytest \ | ||
--cov-report=term-missing:skip-covered \ | ||
--cov-report=xml \ | ||
--cov=form2request \ | ||
--doctest-glob="*.rst" --doctest-modules \ | ||
{posargs:docs form2request tests} | ||
|
||
[testenv:min] | ||
basepython = python3.8 | ||
deps = | ||
{[testenv]deps} | ||
lxml==4.4.1 | ||
|
||
[testenv:pre-commit] | ||
deps = | ||
pre-commit | ||
commands = pre-commit run --all-files --show-diff-on-failure | ||
|
||
[testenv:mypy] | ||
basepython = python3.12 | ||
deps = | ||
mypy==1.10.0 | ||
|
||
commands = mypy form2request tests | ||
|
||
[testenv:docs] | ||
changedir = docs | ||
deps = | ||
-rdocs/requirements.txt | ||
setenv = | ||
READTHEDOCS_PROJECT=form2request | ||
READTHEDOCS_VERSION=main | ||
commands = | ||
sphinx-build -W -n -b html . {envtmpdir}/html | ||
|
||
[testenv:twinecheck] | ||
basepython = python3 | ||
deps = | ||
twine==5.1.0 | ||
build==1.2.1 | ||
commands = | ||
python -m build --sdist | ||
twine check dist/* |