Skip to content

Commit

Permalink
Backend upgrade.
Browse files Browse the repository at this point in the history
Issue #220
  • Loading branch information
Wim-De-Clercq committed Oct 11, 2024
1 parent 3bdf006 commit ec34874
Show file tree
Hide file tree
Showing 24 changed files with 465 additions and 159 deletions.
3 changes: 0 additions & 3 deletions .coveragerc

This file was deleted.

3 changes: 3 additions & 0 deletions .github/pr-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
feature: ['feature/*', 'feat/*']
fix: ['bugfix/*', 'fix/*']
test: test/*
42 changes: 42 additions & 0 deletions .github/workflows/backend.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: crabpy_pyramid tests

on:
push:
paths:
- crabpy_pyramid/**
- tests/**
- .github/workflows/backend.yaml
- pyproject.toml
- requirements*.txt

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ "3.10", "3.11", "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: Display Python version
run: python -c "import sys; print(sys.version)"

- name: Install python requirements
run: |
pip install pip-tools
pip-sync requirements-ci.txt
pip install -e .
- name: Python tests
run: |
flake8
coverage run --source=crabpy_pyramid -m pytest tests
- name: Coveralls
uses: coverallsapp/github-action@v2
22 changes: 22 additions & 0 deletions .github/workflows/pr-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: PR Labeler
on:
pull_request:
types: [opened]
branches:
- 'develop'
- 'epic'

permissions:
contents: read

jobs:
pr-labeler:
permissions:
contents: read # for TimonVS/pr-labeler-action to read config file
pull-requests: write # for TimonVS/pr-labeler-action to add labels in PR
runs-on: ubuntu-latest
steps:
- uses: TimonVS/pr-labeler-action@v4
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
configuration-path: .github/pr-labeler.yml
12 changes: 0 additions & 12 deletions .travis.yml

This file was deleted.

1 change: 0 additions & 1 deletion MANIFEST.in

This file was deleted.

85 changes: 85 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# crabpy_pyramid

Bindings for the crabpy library and the pyramid framework

[![pypi](https://badge.fury.io/py/crabpy_pyramid.png)](http://badge.fury.io/py/crabpy_pyramid)
[![docs](https://readthedocs.org/projects/crabpy-pyramid/badge/?version=latest)](https://readthedocs.org/projects/crabpy-pyramid/?badge=latest)
[![CI](https://github.com/OnroerendErfgoed/crabpy_pyramid/actions/workflows/backend.yaml/badge.svg)](https://github.com/OnroerendErfgoed/crabpy_pyramid/actions/workflows/backend.yaml)
[![coverage](https://coveralls.io/repos/OnroerendErfgoed/crabpy_pyramid/badge.png?branch=master)](https://coveralls.io/r/OnroerendErfgoed/crabpy_pyramid?branch=master)
[![pypi](https://badge.fury.io/py/crabpy_pyramid.png)](http://badge.fury.io/py/crabpy_pyramid)


# Development
## Building the docs

More information about this library can be found in `docs`. The docs can be
built using `Sphinx <http://sphinx-doc.org>`_.

Please make sure you have installed Sphinx in the same environment where
crabpy\_pyramid is present.

```sh
pip install sphinx sphinxcontrib-httpdomain
pip install -e .
cd docs
make html
```

## Build wheel or sdist

```sh
pip install hatch
hatch build
hatch build -t wheel
hatch build -t sdist
```


## Work with pip-compile / pip-sync

full docs: https://pip-tools.readthedocs.io/en/latest/

To start, first install pip-tools:
```sh
pip install pip-tools
```

### uv (optional)

You can also use `uv` and for the remainder of the readme replace `pip`, `pip-compile` or
`pip-sync` by `uv pip`, `uv pip compile` and `uv pip sync`.

`uv` is a very fast replacement for pip-toools. It's optional, but can save a lot of time.
```sh
pip install uv
```

### Install requirements: pip-sync

Note, `pip-sync` also uninstalls everything from the virtualenv which does not belong
there according to the requirements file. This includes the project itself. You will
have to install `crabpy_pyramid` again after `pip-sync`.
Since the requirements file of pip-sync is still a normal requirements file you can also
use `pip install -r` to install all libraries defined in it. This will not cleanup your
virtualenv and uninstall other libraries.

The compiled requirements files are made in a 3.11 environment.
```sh
pip-sync requirements-dev.txt
pip install -e .
```
`requirements-dev.txt` contains all libraries uncluding those for testing and development.

`requirements.txt` contains only the necessary libraries for running the library.

### Update requirements: pip-compile

```sh
echo -e "\nStarting"
PIP_COMPILE_ARGS="-q --strip-extras --no-header --resolver=backtracking --no-emit-options pyproject.toml"
pip-compile $PIP_COMPILE_ARGS -o requirements.txt;
echo "requirements.txt done"
pip-compile $PIP_COMPILE_ARGS --extra dev -o requirements-dev.txt;
echo "requirements-dev.txt done"
echo "Finished"
```
33 changes: 0 additions & 33 deletions README.rst

This file was deleted.

6 changes: 0 additions & 6 deletions nose_cover.cfg

This file was deleted.

5 changes: 0 additions & 5 deletions nose_development.ini

This file was deleted.

5 changes: 0 additions & 5 deletions nose_travis.ini

This file was deleted.

57 changes: 57 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
version = "2.1.1"
name = "crabpy_pyramid"
readme = "README.md"
authors = [
{ name = "Flanders Heritage Agency", email = "[email protected]" },
]
license = {file = "LICENSE"}
description = "Bindings for the CRABpy webservices and the Pyramid framework."
requires-python = ">=3.10,<3.13"
keywords = ["web", "pyramid", "wsgi", "CRAB", "CAPAKEY", "AGIV"]
classifiers = [
'Development Status :: 5 - Production/Stable',
"Programming Language :: Python",
'Programming Language :: Python :: 3.10',
"Framework :: Pyramid",
"Topic :: Internet :: WWW/HTTP",
"Intended Audience :: Developers",
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
]
dependencies = [
"pyramid>=2.0.0",
"crabpy>=1.3.2",
"pycountry>=23.12.11",
]

[project.optional-dependencies]
dev = [
"waitress==3.0.0",
"pytest==8.3.3",
"WebTest==3.0.1",
"responses==0.25.3",
"flake8==7.1.1",
"black==24.10.0",
"uv==0.4.20",
"coveralls==4.0.1"
]

[project.urls]
Repository = "https://github.com/OnroerendErfgoed/crabpy_pyramid.git"
Issues = "https://github.com/OnroerendErfgoed/crabpy_pyramid/issues"
Changelog = "https://github.com/OnroerendErfgoed/crabpy_pyramid/blob/master/CHANGES.rst"

[project.entry-points."paste.app_factory"]
main = "crabpy_pyramid:main"

[tool.hatch.build.targets.wheel]
# In the wheel we want to have crabpy_pyramid in the root as
# python modules.
packages = [
"/crabpy_pyramid",
]
101 changes: 101 additions & 0 deletions requirements-ci.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
beautifulsoup4==4.12.3
# via webtest
black==24.10.0
# via crabpy-pyramid (pyproject.toml)
certifi==2024.8.30
# via requests
charset-normalizer==3.4.0
# via requests
click==8.1.7
# via black
crabpy==1.3.2
# via crabpy-pyramid (pyproject.toml)
decorator==5.1.1
# via dogpile-cache
dogpile-cache==1.3.3
# via crabpy
flake8==7.1.1
# via crabpy-pyramid (pyproject.toml)
hupper==1.12.1
# via pyramid
idna==3.10
# via requests
iniconfig==2.0.0
# via pytest
mccabe==0.7.0
# via flake8
mypy-extensions==1.0.0
# via black
packaging==24.1
# via
# black
# pytest
pastedeploy==3.1.0
# via plaster-pastedeploy
pathspec==0.12.1
# via black
pbr==6.1.0
# via stevedore
plaster==1.1.2
# via
# plaster-pastedeploy
# pyramid
plaster-pastedeploy==1.0.1
# via pyramid
platformdirs==4.3.6
# via black
pluggy==1.5.0
# via pytest
pycodestyle==2.12.1
# via flake8
pycountry==24.6.1
# via crabpy-pyramid (pyproject.toml)
pyflakes==3.2.0
# via flake8
pyramid==2.0.2
# via crabpy-pyramid (pyproject.toml)
pytest==8.3.3
# via crabpy-pyramid (pyproject.toml)
pyyaml==6.0.2
# via responses
requests==2.32.3
# via
# crabpy
# responses
responses==0.25.3
# via crabpy-pyramid (pyproject.toml)
setuptools==75.1.0
# via
# pyramid
# zope-deprecation
# zope-interface
soupsieve==2.6
# via beautifulsoup4
stevedore==5.3.0
# via dogpile-cache
suds-py3==1.4.5.0
# via crabpy
translationstring==1.4
# via pyramid
urllib3==2.2.3
# via
# requests
# responses
uv==0.4.20
# via crabpy-pyramid (pyproject.toml)
venusian==3.1.0
# via pyramid
waitress==3.0.0
# via
# crabpy-pyramid (pyproject.toml)
# webtest
webob==1.8.8
# via
# pyramid
# webtest
webtest==3.0.1
# via crabpy-pyramid (pyproject.toml)
zope-deprecation==5.0
# via pyramid
zope-interface==7.1.0
# via pyramid
Loading

0 comments on commit ec34874

Please sign in to comment.