Skip to content

Commit

Permalink
"Create addon: bika.aquaculture"
Browse files Browse the repository at this point in the history
  • Loading branch information
Lunga001 committed Nov 24, 2023
0 parents commit c2e9fc5
Show file tree
Hide file tree
Showing 58 changed files with 1,968 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[report]
include =
src/bika/*
omit =
*/test*
*/upgrades/*
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[*]
indent_style = space
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8

[{*.py,*.cfg}]
indent_size = 4

[{*.html,*.dtml,*.pt,*.zpt,*.xml,*.zcml,*.js}]
indent_size = 2

[Makefile]
indent_style = tab
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CHANGES.rst merge=union
16 changes: 16 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
* bika.aquaculture version:
* Plone Version:
* Python version:
* Operating System: Linux

### Description

Describe what you were trying to get done.
Tell us what happened, what went wrong, and what you expected to happen.

### What I Did

```
Paste the command(s) you ran and the output.
If there was a crash, please include the traceback here.
```
50 changes: 50 additions & 0 deletions .github/workflows/plone-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# 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: Plone package

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [3.7, 3.8, 3.9, 2.7]

steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
~/.cache/pip
~/buildout-cache
~/extends
key: ${{ runner.os }}-tox-${{ hashFiles('**/setup.py') }}-${{ hashFiles('**/requirements.txt') }}-${{ hashFiles('**/tox.ini') }}
restore-keys: |
${{ runner.os }}-tox-
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install system libraries
run: sudo apt-get install libxml2-dev libxslt1-dev libjpeg-dev
- name: setup buildout cache
run: |
mkdir -p ~/buildout-cache/{eggs,downloads}
mkdir ~/.buildout
echo "[buildout]" > $HOME/.buildout/default.cfg
echo "download-cache = $HOME/buildout-cache/downloads" >> $HOME/.buildout/default.cfg
echo "eggs-directory = $HOME/buildout-cache/eggs" >> $HOME/.buildout/default.cfg
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions
- name: Test with tox
run: |
tox -r
33 changes: 33 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
.coverage
*.egg-info
*.log
*.mo
*.py?
*.swp
# dirs
bin/
buildout-cache/
develop-eggs/
eggs/
htmlcov/
include/
lib/
local/
node_modules/
parts/
dist/*
test.plone_addon/
var/
# files
.installed.cfg
.mr.developer.cfg
lib64
log.html
output.xml
pip-selfcheck.json
report.html
.vscode/
.tox/
reports/
venv/
# excludes
70 changes: 70 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# This file is a template, and might need editing before it works on your project.
# Official language image. Look for the different tagged releases at:
# https://hub.docker.com/r/library/plone/tags/
image: python:2.7-stretch

# Change pip's cache directory to be inside the project directory since we can
# only cache local items.
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache"

# Pip's cache doesn't store the python packages
# https://pip.pypa.io/en/stable/reference/pip_install/#caching
#
# If you want to also cache the installed packages, you have to install
# them in a virtualenv and cache it as well.
cache:
paths:
- .cache/pip
- venv/
- downloads/
- eggs/

# Set execution order: first run jobs on 'test' stage on parallel
# then run jobs on 'report' stage
stages:
- test
- report

before_script:
- echo "deb http://ftp.de.debian.org/debian/ stretch main contrib non-free" >> /etc/apt/sources.list
- apt-get update
- apt-get install -y firefoxdriver
- apt-get install -y xvfb
- python -V # Print out python version for debugging
- pip install virtualenv
- export LC_CTYPE=en_US.UTF-8
- export LC_ALL=en_US.UTF-8
- export LANG=en_US.UTF-8
- virtualenv --clear -p python2.7 venv
- source venv/bin/activate
- pip install -r requirements.txt
- buildout bootstrap
- bin/buildout -n -c buildout.cfg code-analysis:return-status-codes=True

code-analysis:
stage: test
# still not available, see: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5004
# success_with_warnings: True
script:
- bin/code-analysis

robot:
stage: test
script:
- export DISPLAY=:99.0
# - sh -e /etc/init.d/xvfb start
- xvfb-run bin/test --all

coverage:
stage: report
script:
- bin/createcoverage
- bin/coverage html
- bin/coverage report
when: on_success

coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+\%)/'
artifacts:
paths:
- htmlcov
61 changes: 61 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
dist: bionic
language: python
cache:
pip: true
directories:
- eggs
- $HOME/buildout-cache
- $HOME/.buildout
python:
- "2.7"
matrix:
include:
- python: "2.7"
env: PLONE_VERSION=43
- python: "2.7"
env: PLONE_VERSION=51
- python: "2.7"
env: PLONE_VERSION=52
- python: "3.7"
env: PLONE_VERSION=52
fast_finish: true

before_install:
- mkdir -p $HOME/buildout-cache/{downloads,eggs,extends}
- mkdir -p $HOME/.buildout
- echo "[buildout]" > $HOME/.buildout/default.cfg
- echo "download-cache = $HOME/buildout-cache/downloads" >> $HOME/.buildout/default.cfg
- echo "eggs-directory = $HOME/buildout-cache/eggs" >> $HOME/.buildout/default.cfg
- echo "extends-cache = $HOME/buildout-cache/extends" >> $HOME/.buildout/default.cfg
- echo "abi-tag-eggs = true" >> $HOME/.buildout/default.cfg
- git config --global user.email "[email protected]"
- git config --global user.name "Travis CI"
- sudo apt-get install -y firefox-geckodriver
- virtualenv -p `which python` .
- bin/pip install -r requirements.txt -c constraints_plone$PLONE_VERSION.txt
- cp test_plone$PLONE_VERSION.cfg buildout.cfg

install:
- travis_retry pip install -U tox coveralls coverage -c constraints.txt

before_script:
- 'export DISPLAY=:99.0'
- export VERBOSE=true
- Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
- sleep 3

script:
- PYTEST_ADDOPTS="-s -vv" tox

after_success:
- python -m coverage.pickle2json
- coverage combine
- coveralls

notifications:
email:
recipients:
# - [email protected]
- {author}
on_success: change
on_failure: change
9 changes: 9 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Changelog
=========


1.0a1 (unreleased)
------------------

- Initial release.
[lunga001]
4 changes: 4 additions & 0 deletions CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Contributors
============

- Lunga Baliwe, [email protected]
42 changes: 42 additions & 0 deletions DEVELOP.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
Using the development buildout
==============================

Create a virtualenv in the package::

$ virtualenv --clear .

Install requirements with pip::

$ ./bin/pip install -r requirements.txt

Run buildout::

$ ./bin/buildout

Start Plone in foreground:

$ ./bin/instance fg


Running tests
-------------

$ tox

list all tox environments:

$ tox -l
py27-Plone43
py27-Plone51
py27-Plone52
py37-Plone52
build_instance
code-analysis
lint-py27
lint-py37
coverage-report

run a specific tox env:

$ tox -e py37-Plone52

Loading

0 comments on commit c2e9fc5

Please sign in to comment.