Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions .github/workflows/plone-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,17 @@ jobs:
plone-version:
- 'Plone52'
- 'Plone60'
python-version: [3.7, 3.8, 3.9]
python-version: ["3.8", "3.11"]
exclude:
- plone-version: Plone52
python-version: "3.11"
- plone-version: Plone60
python-version: "3.8"

steps:
- uses: actions/setup-python@v4
with:
python-version: '3.9'
python-version: '3.11'
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
Expand All @@ -49,17 +54,12 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions
- name: Black-Check
run: |
tox -r -e black-check
# - name: Black-Check
# run: |
# tox -r -e black-check
- name: Test with tox
run: |
tox -r
env:
PLONE-VERSION: ${{ matrix.plone-version }}
PYTHON-VERSION: ${{ matrix.python-version }}
- name: "Upload coverage to Codecov"
uses: "codecov/codecov-action@v3"
with:
fail_ci_if_error: true
if: matrix.python-version == '3.7'
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ pyvenv.cfg
report.html
.vscode/
.tox/
.python-version
reports/
venv/
# excludes
9 changes: 7 additions & 2 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,15 @@ Changelog
=========


1.0.2 (unreleased)
1.1.0 (unreleased)
------------------

- Nothing changed yet.
- aggiornati i dati con nuuovo CSV da ISTAT
[mamico]
- fix CI / gha
[mamico]
- aggiunte costanti per dizionari precalcolati per PROVINCE e COMUNI
[mamico]


1.0.1 (2024-03-12)
Expand Down
31 changes: 0 additions & 31 deletions base.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ parts =
releaser
i18ndude
omelette
robot
plone-helper-scripts
vscode

develop = .

Expand All @@ -32,17 +29,6 @@ eggs =
Pillow
redturtle.unitaterritoriali [test]

[vscode]
recipe = collective.recipe.vscode
eggs = ${instance:eggs}
autocomplete-use-omelette = True

# [code-analysis]
# recipe = plone.recipe.codeanalysis
# directory = ${buildout:directory}/src/redturtle
# return-status-codes = False


[omelette]
recipe = collective.recipe.omelette
eggs = ${instance:eggs}
Expand Down Expand Up @@ -80,13 +66,6 @@ recipe = zc.recipe.egg
eggs = createcoverage


[robot]
recipe = zc.recipe.egg
eggs =
${test:eggs}
plone.app.robotframework[debug,reload]


[releaser]
recipe = zc.recipe.egg
eggs = zest.releaser
Expand All @@ -96,16 +75,6 @@ eggs = zest.releaser
recipe = zc.recipe.egg
eggs = i18ndude

[plone-helper-scripts]
recipe = zc.recipe.egg
eggs =
plone.staticresources
${instance:eggs}
interpreter = zopepy
scripts =
zopepy
plone-compile-resources

[versions]
# Don't use a released version of redturtle.unitaterritoriali
redturtle.unitaterritoriali =
9 changes: 1 addition & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

setup(
name="redturtle.unitaterritoriali",
version="1.0.2.dev0",
version="1.1.0.dev0",
description="An add-on for Plone",
long_description=long_description,
# Get more from https://pypi.org/classifiers/
Expand Down Expand Up @@ -53,10 +53,6 @@
python_requires=">=3.7",
install_requires=[
"setuptools",
# -*- Extra requirements: -*-
"z3c.jbot",
"plone.api>=1.8.4",
"plone.app.dexterity",
],
extras_require={
"test": [
Expand All @@ -66,13 +62,10 @@
# plone_coredev tests as of 2016-04-01.
"plone.testing>=5.0.0",
"plone.app.contenttypes",
"plone.app.robotframework[debug]",
],
},
entry_points="""
[z3c.autoinclude.plugin]
target = plone
[console_scripts]
update_locale = redturtle.unitaterritoriali.locales.update:update_locale
""",
)
1 change: 1 addition & 0 deletions src/redturtle/unitaterritoriali/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
"""Init and utils."""

from zope.i18nmessageid import MessageFactory


Expand Down
7,899 changes: 7,899 additions & 0 deletions src/redturtle/unitaterritoriali/codici_statistici_01_01_2026.csv

Large diffs are not rendered by default.

25 changes: 1 addition & 24 deletions src/redturtle/unitaterritoriali/testing.py
Original file line number Diff line number Diff line change
@@ -1,29 +1,16 @@
# -*- coding: utf-8 -*-
from plone.app.robotframework.testing import REMOTE_LIBRARY_BUNDLE_FIXTURE
from plone.app.testing import applyProfile
from plone.app.testing import FunctionalTesting
from plone.app.testing import IntegrationTesting
from plone.app.testing import PLONE_FIXTURE
from plone.app.testing import PloneSandboxLayer
from plone.testing import z2

import redturtle.unitaterritoriali


class RedturtleUnitaterritorialiLayer(PloneSandboxLayer):

defaultBases = (PLONE_FIXTURE,)

def setUpZope(self, app, configurationContext):
# Load any other ZCML that is required for your tests.
# The z3c.autoinclude feature is disabled in the Plone fixture base
# layer.
import plone.app.dexterity

self.loadZCML(package=plone.app.dexterity)
import plone.restapi

self.loadZCML(package=plone.restapi)
self.loadZCML(package=redturtle.unitaterritoriali)

def setUpPloneSite(self, portal):
Expand All @@ -39,17 +26,7 @@ def setUpPloneSite(self, portal):
)


REDTURTLE_UNITATERRITORIALI_FUNCTIONAL_TESTING = FunctionalTesting(
FUNCTIONAL_TESTING = FunctionalTesting(
bases=(REDTURTLE_UNITATERRITORIALI_FIXTURE,),
name="RedturtleUnitaterritorialiLayer:FunctionalTesting",
)


REDTURTLE_UNITATERRITORIALI_ACCEPTANCE_TESTING = FunctionalTesting(
bases=(
REDTURTLE_UNITATERRITORIALI_FIXTURE,
REMOTE_LIBRARY_BUNDLE_FIXTURE,
z2.ZSERVER_FIXTURE,
),
name="RedturtleUnitaterritorialiLayer:AcceptanceTesting",
)
33 changes: 0 additions & 33 deletions src/redturtle/unitaterritoriali/tests/test_robot.py

This file was deleted.

76 changes: 0 additions & 76 deletions src/redturtle/unitaterritoriali/tests/test_setup.py

This file was deleted.

28 changes: 22 additions & 6 deletions src/redturtle/unitaterritoriali/tests/test_utility.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# -*- coding: utf-8 -*-
import unittest
from zope.component import getUtility
from redturtle.unitaterritoriali.interfaces import IUnitaTerritorialiUtility
from redturtle.unitaterritoriali.testing import (
REDTURTLE_UNITATERRITORIALI_FUNCTIONAL_TESTING,
)
from redturtle.unitaterritoriali.testing import FUNCTIONAL_TESTING
from redturtle.unitaterritoriali.utility import load_data_from_csv
from zope.component import getUtility

import unittest


class ModelloPraticaIntegrationTest(unittest.TestCase):
layer = REDTURTLE_UNITATERRITORIALI_FUNCTIONAL_TESTING
layer = FUNCTIONAL_TESTING

def test_utility(self):
utility = getUtility(IUnitaTerritorialiUtility)
Expand All @@ -23,3 +23,19 @@ def test_utility(self):
res = utility.codice_istat_to_comune(codice_istat)
self.assertIn("denominazione", res)
self.assertIn("codice_catastale", res)

def test_sardegna_2026(self):
comuni = load_data_from_csv()

prov_key = "Denominazione dell'Unità territoriale sovracomunale \n(valida a fini statistici)"
self.assertEqual(
len([c for c in comuni if c[prov_key] == "Cagliari"]),
70,
)

self.assertEqual(
len(
[c for c in comuni if c[prov_key] == "Medio Campidano"]
), # ex Sud Sardegna
28,
)
Loading
Loading