Commit Graph

184 Commits

Author SHA1 Message Date
Simone Robutti 94c85d8b48
introduce locale (#165)
* introduced locale option

* added tests
2022-04-11 18:13:35 +02:00
Giacomo Leidi 4e40a1979e
Add completion scripts. (#166) 2022-04-11 08:36:10 +02:00
Giacomo Leidi 5f51d68c82 Release v0.3.0. 2022-04-04 11:35:24 +02:00
Giacomo Leidi 05a8c9d5b0
Update docker-compose.yml 2022-03-30 21:21:31 +02:00
Giacomo Leidi 981fcf0486
Fix recap (#161)
* Drop dependency on python-telegram-bot, as it's not used.

* Align default templates.

This patch tries to bring some consistency to the default templates and
fixes some small bug in the output of some formatters.
2022-03-26 22:46:33 +01:00
Giacomo Leidi 002399161d
Pull publish (#157)
* Add pull command.

* Add publish command.

* Enforce start's old semantics.

* Add pull test cases:

- Pull with no events anywhere
- Pull with one event on mobilizon and none on the db
- Pull with one event on mobilizon and another on the db
- Pull with one event on mobilizon and the same event on the db

* Add pull tests:

- Sequence: pull->start
- Sequence: start->pull
- Sequence: pull->new event on mobilizon -> pull

* manifest.scm: Add cloc.

* query: read: Prefer return list to generators.

* tests: pull: Actually test that models are written to the DB.
2022-03-22 21:16:34 +01:00
Simone Robutti 3e7b9097a4
Update twitter.tmpl.j2 (#160)
* Update twitter.tmpl.j2

* Update twitter_recap.tmpl.j2
2022-03-15 21:52:14 +01:00
Giacomo Leidi af45f2b5ea
Run CI for pull requests. (#159) 2022-03-13 21:51:25 +01:00
Giacomo Leidi f8a614750c
Upstream python-tweepy. (#155)
* Upstream python-tweepy.

* Update requests to 2.26.

* Remove python-requests-2.25 as it's not needed.

* Add guide to update dependencies.

* Fix link.
2022-03-12 11:29:56 +01:00
Giacomo Leidi e558034194 Release v0.2.3. 2022-03-07 10:20:13 +01:00
Simone Robutti 1217b17326
fix event retry (#152)
* added twitter error handling

* added facebook tests

* added header format test

* added multiple newlines check

* added test list command

* fixed commands structure

* fixed event retry

* fixed publication retry

* added publication tests

* removed unused option

* fixed list begin/end window

* added test retry failures

* linting

* refactored sender

* added timezone freeze

* fixed facebook-sdk and beatifulsoup errors
2022-03-06 10:41:02 +01:00
Simone Robutti 8b81ceedd0
Merge pull request #154 from Tech-Workers-Coalition-Italia/set_timezone
set timezone
2022-03-04 10:57:01 +01:00
Simone Robutti dae9dfd889 set timezone to CUT 2022-03-04 10:56:20 +01:00
Simone Robutti cb0fe7b5fc
set timezone to Rome (#153) 2022-03-04 10:45:11 +01:00
Simone Robutti f04942eefe
test commands (#151)
* added twitter error handling

* added facebook tests

* added header format test

* added multiple newlines check

* added test list command

* fixed commands structure
2022-03-02 08:59:57 +01:00
Simone Robutti 420f823dd4
platform tests (#150)
* added twitter error handling

* added facebook tests

* added header format test

* added multiple newlines check
2022-03-02 08:59:49 +01:00
Giacomo Leidi 9c77afa456 Restore tests in Guix package. 2022-03-01 23:42:32 +01:00
Giacomo Leidi db659e9cdc Release v0.2.2. 2022-02-24 00:06:54 +01:00
Giacomo Leidi ca878454b4 mobilizon-reshare.scm: Hotfix applied to the image
This patch allows mobilizon-reshare to be installed in a Guix profile.
2022-02-24 00:04:20 +01:00
Giacomo Leidi 5afbcd2192 Release v0.2.1. 2022-02-23 23:10:38 +01:00
magowiz 8ff6555c60
Feature/autogenerate api doc (#147)
* initial commit with generate-doc.sh script and generated documentation, added pdoc3 dependency

* fixed import errors due to missing SECRETS_FOR_DYNACONF environment value, updated doc, force/overwrite if documentation exists

* moved pdoc3 dependency from dependencies to dev-dependencies

* removed generated doc

* add api-documentation (pdoc3 target directory) to .gitignore

* switch to sphinx which supports better typehints notation

* remove module path prefix from methods name

* add support for typehints

* remove autogenerated files

* ignore autogenerated files

* fixed typo in .gitignore

* added empty _static folder to avoid warning on build

* initial commit with generate-doc.sh script and generated documentation, added pdoc3 dependency

* fixed import errors due to missing SECRETS_FOR_DYNACONF environment value, updated doc, force/overwrite if documentation exists

* moved pdoc3 dependency from dependencies to dev-dependencies

* removed generated doc

* switch to sphinx which supports better typehints notation

* remove autogenerated files

* remove gui browser documentation open, use /bin/sh instead of /bin/bash

* remove windows/dos documentation generation make, drop windows/dos support

Co-authored-by: Giacomo Leidi <goodoldpaul@autistici.org>
2022-02-23 17:29:37 +01:00
Giacomo Leidi 529f83825e
Pave the way for using only EventPublications outside of storage module. (#149)
* Move `EventPublication.from_orm` to `storage.query.converter`.

Co-authored-by: Simone Robutti <simone.robutti@protonmail.com>
2022-02-23 17:26:13 +01:00
Simone Robutti bda4b8ee0d
fix timezone in test (#145)
* added timezone fixture

* Make output dependent on local timezone.

* Fix non deterministic behavior in html to text conversion.

Co-authored-by: Giacomo Leidi <goodoldpaul@autistici.org>
2022-02-22 11:28:16 +01:00
Giacomo Leidi e003cf9a90
README.md: Add Pypi link. (#148) 2022-02-21 15:26:03 +01:00
Giacomo Leidi d19f3ac5ca
scheduler.py: Fix intervals. (#146)
APScheduler uses 0-indexed week days.
2022-02-20 12:45:50 +01:00
Simone Robutti b0e88a9e1f
fixed missing whitespace (#143) 2022-02-16 15:54:10 +01:00
Simone Robutti 11de1e1213
fixed facebook format (#142) 2022-02-16 13:51:00 +01:00
Giacomo Leidi 9c44c8d730
Enforce the same dependencies in dev and prod. (#141)
This patch restores Guix' full sanity check, which runs the CLI
entrypoint to verify all required dependencies are present.
2022-02-16 12:23:31 +01:00
Giacomo Leidi e96ee55b48 Release v0.2.0. 2022-02-14 21:12:31 +01:00
Simone Robutti f0a7449336
rework maintenance cli (#140)
* added default

* moved object before verb

* added event retry

* added publication_retry

* renamed inspect to list

* fixed retry publication

* fixed retry event and structure
2022-02-14 21:10:27 +01:00
Simone Robutti ade3204c54
added default (#138) 2022-02-14 21:10:14 +01:00
magowiz 45802ecbdd
Feature/optimizing download (#118)
* add column last_update_time

* save last_update_time in event db record

* use id + updatedAt for comparison instead of mobilizon_id, this will treat updated events like new ones

* rework event selection/comparison to include unpublished with updates to ones need to be saved

* added update for unpublished events

* tests: test_update: Add create_unpublished_events tests.

* Move `MobilizonEvent.to_model` to `storage.query`

* Move `MobilizonEvent.from_model` to `storage.query`

* Move `MobilizonEvent.compute_status` to `storage.query`

* Move `publishers.exception.EventNotFound` to `storage.query.exceptions`
2022-02-09 00:54:56 +01:00
Giacomo Leidi eeb9b04e3e
Update README.md 2022-02-06 22:29:39 +01:00
Giacomo Leidi ad8647704d
Add event name to notifications. (#136) 2022-02-05 18:46:48 +01:00
Giacomo Leidi 3ef8b1f97b
Python scheduler docker image (#134)
* Move scheduler.py into scripts/ .

* docker: Python scheduler image.

* Update channels-lock.scm.

* Use tortoise 0.18.1 and aerich 0.6.2.

* Use fishinthecalculator/publish-docker-image-action@v0.1.10 .

* Make intervals configurable.

* Add platforms to README.md .
2022-02-05 18:46:02 +01:00
Simone Robutti 8c16812ed0
added scheduling (#133) 2022-01-27 20:54:14 +01:00
Giacomo Leidi 1f1ff2e5c2
Debug image (#131)
* config: get_settings_files_paths: Return first existing path.

* tests: Set SETTINGS_FOR_DYNACONF at import time.

* config: get_settings_files_paths: Log config path.

* manifest.scm: Add docker-compose.

* build_docker_image.sh: Allow building debug image.

* storage: db: Use the same configuration for Tortoise and Aerich.

* Distribuite migration queries.

* storage: implement_db_changes: Use pkg_resources.
2022-01-26 10:11:16 +01:00
Giacomo Leidi e109106af9
Use test script everywhere in the pipeline. (#130) 2022-01-24 22:34:52 +01:00
Simone Robutti 7aa1587b2b moved run tests to script 2022-01-20 11:58:44 +01:00
Simone Robutti 994102c937
added timezone_sensitive marker (#129) 2022-01-20 11:30:11 +01:00
Simone Robutti 5804b55dd8
Fix markdown cropping (#128)
* fixed error log

* changed telegram publisher to use HTML format

* fixed dataclass update issue

* docker: Add python-telegram-bot.

* docker: mobilizon-reshare: Reenable non deterministic tests.

Co-authored-by: Giacomo Leidi <goodoldpaul@autistici.org>
2022-01-18 01:39:00 +01:00
Giacomo Leidi 434438fd20
Add Docker Hub link to README.md. (#127) 2022-01-12 01:59:58 +01:00
Giacomo Leidi 3d704cc6b2
docker: Upstream python-markdownify. (#126) 2022-01-09 04:12:34 +01:00
Simone Robutti a0a1d43fa0
rework config (#121)
* simplified config behavior

* temp

* removed redundant tests

* removed publication window

* removed settings_file cli option

* add pre_test code, in order to set environment variables

* Revert "add pre_test code, in order to set environment variables"

This reverts commit 0d25f9313a.

Co-authored-by: magowiz <magowiz@gmail.com>
Co-authored-by: Giacomo Leidi <goodoldpaul@autistici.org>
2022-01-08 00:54:27 +01:00
Giacomo Leidi 352c49ca94
Rewrite README.md. (#125)
* Rewrite README.md.

This patch moves most information about the internals of
mobilizon-reshare to the manual to keep the README light and
easy to follow.
2022-01-07 23:49:36 +01:00
Giacomo Leidi 8569a903f1
Run CI tests for every push to master (#123)
* workflows: Separate release workflow from main.
2022-01-05 23:52:25 +01:00
Simone Robutti 5bce70b4a1
retry command (#119)
* added failed publication retrieval

* completed retry command

* added more error handling

* added atomic to query
2022-01-04 21:35:43 +01:00
Giacomo Leidi 43d653f37c
Update guix package definition after core-updates merge. (#122) 2022-01-03 20:14:31 +01:00
Simone Robutti c63ff905e5
Merge pull request #117 from Tech-Workers-Coalition-Italia/fix/aerich
add intermediate variable since aerich doesn't play nice with functions as configuration entrypoint
2021-12-18 13:00:59 +01:00
magowiz 86e698271c add intermediate variable since aerich doesn't play nice with functions as configuration entrypoint 2021-12-18 12:54:09 +01:00