Commit Graph

58 Commits

Author SHA1 Message Date
Giacomo Leidi 904aa06629
Fix docker image. 2024-03-02 00:12:05 +01:00
Giacomo Leidi be715d201c
Update dependencies. 2024-03-01 23:38:11 +01:00
Giacomo Leidi e381c1b522
Migrate to importlib and update some dependencies (#189)
* Migrate to importlib.

* Update CI
2024-01-28 21:08:17 +01:00
Giacomo Leidi 056e0217aa
Release v0.3.6. 2023-07-16 15:33:26 +02:00
Giacomo Leidi c40a7aca35
Release v0.3.5. 2023-06-10 23:27:34 +02:00
Giacomo Leidi 3874acf247
Failures (#183)
* Update beautifulsoup4 to 4.11.

* Update docker image.

* Add type annotations.

* Publish where you can and notify errors.

* Add tests for partial publishing.
2023-05-22 12:53:32 +02:00
Giacomo Leidi 6b72b2630f
Update tweepy to 4.13. 2023-04-18 01:16:16 +02:00
Simone Robutti ddc706e201
Add publication crud (#178)
* fixed parsing bug

* implemented events and publications endpoints

split endpoints by entity

removed credentials

* add pagination (#179)

* added pagination

* integrated pagination with tortoise

* added test for publications

* removed converter file

* updated dependencies
2022-12-07 21:46:57 +01:00
Giacomo Leidi 081ca87857
Update dependencies. (#177) 2022-11-13 14:31:03 +01:00
Giacomo Leidi 04f29e37e4
Drop Guix CI for master and PRs. (#176) 2022-10-20 19:16:57 +02:00
Simone Robutti 44340fde8f
Introduced FastAPI and Postgres support (#173)
* added poc

* added check for sqlite db

* added events test

* draft docker-compose-test.yml

* improved docker-compose

* added support for postgres migrations

* add documentation

* added some qol to migrations

* added migration generation script

* removed settings.toml

* waiting for postgress in script

* commented script

* added sample web config

* fixed tests

* mock memory db

* reviewed PR
2022-10-14 22:11:27 +02:00
Giacomo Leidi 4ce6c7b171
Update dependencies. (#170)
* Update Guix commit.

* Update dependencies

* Drop CONNECTION_NAME hack.
2022-07-26 22:23:47 +02:00
Giacomo Leidi cf2fabefb4 Release v0.3.2. 2022-06-05 19:12:08 +02:00
Giacomo Leidi b66c94c8a2
Add publish command. (#167)
* Add publish command.

* publish: Add tests.

* Add list-platforms and test-configuration.

* Update Guix dependencies.

* Move publishing of events and publications to retry.
2022-05-17 23:14:52 +02:00
Giacomo Leidi 7f3ce9a55a Release v0.3.1. 2022-04-19 21:53:02 +02:00
Giacomo Leidi 5f51d68c82 Release v0.3.0. 2022-04-04 11:35:24 +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 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
Giacomo Leidi db659e9cdc Release v0.2.2. 2022-02-24 00:06:54 +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
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 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 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 43d653f37c
Update guix package definition after core-updates merge. (#122) 2022-01-03 20:14:31 +01:00
Simone Robutti 31da51b69b
Merge pull request #110 from magowiz/feature/aerich
Feature/aerich
2021-12-14 22:54:50 +01:00
Simone Robutti 7c39d94b48 added new test 2021-12-05 16:50:37 +01:00
magowiz 1195aef57e installed aerich 2021-12-04 14:40:34 +01:00
Giacomo Leidi a079241801 Add pytest-cov dependency. 2021-11-28 17:27:12 +01:00
magowiz 18e97c863d
change report format from html to term-missing 2021-11-27 23:35:30 +01:00
magowiz d60c5eabfb add pytest coverage configuration 2021-11-27 18:47:43 +01:00
Simone Robutti 2476686c33
added facebook publisher (#99)
* added facebook publisher

* mobilizon-reshare.git: [propagated-inputs]: Add python-sdk-facebook.

This package definition has been generated with `guix import pypi -r
facebook-sdk`.

* mobilizon-reshare.git: [propagated-inputs]: Use python-facebook-sdk.git.

Co-authored-by: Giacomo Leidi <goodoldpaul@autistici.org>
2021-11-20 15:40:10 +01:00
Simone Robutti 5335ed8cc3
command tests (#97)
* filtering publications with inactive publishers

* filtering publications with inactive publishers

* WIP: Generate publications at runtime.

TODO:
- change `MobilizonEvent.compute_status`'s contract and break everything
- while we're at it we should remove `PublicationStatus.WAITING`
- test `storage.query.create_publications_for_publishers`

* cli: inspect_events: Unnest if-then-else.

* publishers: abstract: Remove `EventPublication.make`.

* fixed tests

* split query.py file

* added tests for get_unpublished_events

* added tests

* more tests

* added start test

* refactored start test

* added test start with db event

* added test recap

* added failed publication test

* added format test

Co-authored-by: Giacomo Leidi <goodoldpaul@autistici.org>
2021-11-11 16:20:50 +01:00
Simone Robutti c14cdfb67f
twitter (#77)
* added basic recap feature (no error handling)

* introduced abstractpublication

* extracted base reports

* added error report to recap

* added test

* added docs

* implemented publisher and formatter

* fixed API for recap

* removed redundant config validation

* added config sample
2021-10-17 14:05:16 +02:00
Simone Robutti 5db7fb8597
Metadata (#68)
* decoupled notifiers from event

* stub

* publishers working

* fixed format CLI

* fixed unit tests

* renamed abstractnotifier

* added another excluded character

* restored bundled secrets file

* test telegram escape

* tested telegram event validation

* added telegram response validation

* added pragma

* added zulip response validation test

* added metadata to pyproject.toml

* improved documentation
2021-10-05 15:32:18 +02:00
Giacomo Leidi 6f81522ad0 Release v0.1.0. 2021-09-28 11:40:04 +02:00
tinoilcotechino 394d84b0a5
settings.toml: Move secrets to dedicated file. (#60)
Configuration files are checked in this order:

      1. CLI argument
      2. `$MOBILIZION_RESHARE_SETTINGS_FILE` environment variable;
      3. User configuration directory. On Linux that's `$XDG_CONFIG_HOME/mobilizon_reshare/<mobilizon-reshare-version>`;
      4. System configuration directory. On Linux that's the first element in `$XDG_CONFIG_DIRS` + `/mobilizon_reshare/<mobilizon-reshare-version>`.
      5. The default configuration distributed with the package.

The first available configuration file will be loaded. Secrets can be set either
via environment variables (such as `export MOBILIZON_RESHARE_PUBLISHER_TELEGRAM_TOKEN="my-telegram-token"` )
or by setting the `$SECRETS_FOR_DYNACONF` environment variable to a `secrets.(toml|yaml|ini|json)` file.

Co-authored-by: Giacomo Leidi <goodoldpaul@autistici.org>
2021-09-07 23:39:58 +02:00
tinoilcotechino fa32af4b09
Add release.sh. (#53)
Co-authored-by: Giacomo Leidi <goodoldpaul@autistici.org>
2021-08-31 00:10:48 +02:00
Simone Robutti 2c8063cf4a
rename everything (#50)
* fixed visualization

* simplified tests

* split into files

* refactored test expected publications

* split update tests

* expanded specifications and tests

* added event_status window tests

* fixed 'all' command

* renamed everything

* fixed uppercase
2021-08-16 10:49:52 +02:00
Simone Robutti 880a34115f
extend cli (#48)
* fixed teardown

* Updated statuses management, tests (#41)

* Updated statuses management, tests

* storage: query: Generalize event loading logic.

* reformat

* storage: query: Rename load_events to prefetch_event_relations.

Co-authored-by: Giacomo Leidi <goodoldpaul@autistici.org>

* fixed test_window_no_event

* added strategy tests

* removed unused code

* added config tests

* added more config tests

* refactored tests

* updated pytest

* added inspect_all

* temp

* added colors

* storage: events_with_status: Use `EventPublicationStatus`.

* storage: events_with_status: Enable closed ranges.

* added time window to CLI

Co-authored-by: SlyK182 <60148777+SlyK182@users.noreply.github.com>
Co-authored-by: Giacomo Leidi <goodoldpaul@autistici.org>
2021-08-04 18:53:58 +02:00
Simone Robutti 929e3aa78e
added format to markdown (#43)
* added format to markdown

* comments

* added markdown tests
2021-07-21 09:13:32 +02:00
Simone Robutti 8a27de8981
add tests (#44)
* fixed test_window_no_event

* added strategy tests

* removed unused code

* added config tests

* added more config tests

* refactored tests

* updated pytest
2021-07-18 18:23:30 +02:00
Simone Robutti 40919a994f
publication window (#24)
* added get events stub

* added event parsing

* removed datetime

* added config and tests

* fixed response format in test

* more tests

* added error handling for request

* improved dummy data

* added get_unpublished_events

* added test

* removed last_accessed

* mobilizon_url moved to fixture

* added config comments

* moved mobilizon group to config

* added method

* removed non-working test settings

* added publishing window logic and tests

* added inner/outer window check and mocking

* improved fixture

* fixed outer window

* fixed tests
2021-07-07 11:19:37 +02:00
Simone Robutti 891d523751
added CLI (#27) 2021-07-05 21:58:29 +02:00
tinoilcotechino c129edd1e5
Add models (#18) 2021-05-31 01:11:50 +02:00
Simone Robutti fcd5116d1c
download events (#19)
* added get events stub

* added event parsing

* removed datetime

* added config and tests

* fixed response format in test

* more tests

* added error handling for request

* improved dummy data

* added get_unpublished_events

* added test

* removed last_accessed

* mobilizon_url moved to fixture

* added config comments

* moved mobilizon group to config
2021-05-30 21:47:36 +02:00
tinoilcotechino 47f8c0aa17
Merge pull request #4 from Tech-Workers-Coalition-Italia/conf
Basic configuration.
2021-05-09 15:59:41 +02:00