Git Product home page Git Product logo

messages-package's People

Contributors

github-actions[bot] avatar obervinov avatar

Watchers

 avatar  avatar

messages-package's Issues

Fix `install_requires` and `dependency_links` in setup.py

example

"""
This module is necessary to distribute and install the written module via pip
"""
from setuptools import setup

with open('README.md', 'r', encoding='utf8') as readme:
    readme_content = readme.read()
with open('CHANGELOG.md', 'r', encoding='utf8') as changelog:
    changelog_content = changelog.read()

setup(
    name='users',
    version='1.0.3',
    license='MIT',
    description=(
        "This module contains classes and functions for implementing"
        "the simplest authorization for telegram bots"
    ),
    py_modules=["users"],
    package_dir={'': 'users'},
    author='Oleg Bervinov',
    author_email='[email protected]',
    long_description=(f"{readme_content}""\n\n"f"{changelog_content}"),
    long_description_content_type="text/markdown",
    url='https://github.com/obervinov/users-package',
    include_package_data=True,
    classifiers=[
        "License :: OSI Approved :: MIT License",
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.6',
        'Programming Language :: Python :: 3.7',
        'Programming Language :: Python :: 3.8',
        'Programming Language :: Python :: 3.9',
        'Programming Language :: Python :: 3.10',
        'Programming Language :: Python :: 3.11',
        'Operating System :: OS Independent'
    ],
    keywords=['users', 'authentication'],
    install_requires=[
        'logger @ https://github.com/obervinov/logger-package/tarball/v1.0.1#egg=logger-1.0.1',
        'vault @ https://github.com/obervinov/vault-package/tarball/v2.0.0#egg=vault-2.0.0',
    ],
    dependency_links=[
        'https://github.com/obervinov/logger-package/tarball/v1.0.1#egg=logger-1.0.1'
        'https://github.com/obervinov/vault-package/tarball/v2.0.0#egg=vault-2.0.0'
    ]
)

Add additional exceptions for more informative errors

  • if the number of input arguments does not match the template (or if index argument in template body is wrong: {3})
          "post_already_downloaded": {
              "text": "{0} The content of the post <b>{1}</b> has already been downloaded.\n{3} The download was skipped.",
              "args": [":construction:", "post_id", ":boxing_glove:"]
          }
    Traceback (most recent call last):
      File "/home/pyinstabot-downloader/app/src/bot.py", line 521, in <module>
        main()
      File "/home/pyinstabot-downloader/app/src/bot.py", line 517, in main
        telegram.launch_bot()
      File "/home/pyinstabot-downloader/app/.venv/lib/python3.9/site-packages/telegram/telegram.py", line 202, in launch_bot
        self.telegram_bot.polling(
      File "/home/pyinstabot-downloader/app/.venv/lib/python3.9/site-packages/telebot/__init__.py", line 1104, in polling
        self.__threaded_polling(non_stop=non_stop, interval=interval, timeout=timeout, long_polling_timeout=long_polling_timeout,
      File "/home/pyinstabot-downloader/app/.venv/lib/python3.9/site-packages/telebot/__init__.py", line 1179, in __threaded_polling
        raise e
      File "/home/pyinstabot-downloader/app/.venv/lib/python3.9/site-packages/telebot/__init__.py", line 1141, in __threaded_polling
        self.worker_pool.raise_exceptions()
      File "/home/pyinstabot-downloader/app/.venv/lib/python3.9/site-packages/telebot/util.py", line 149, in raise_exceptions
        raise self.exception_info
      File "/home/pyinstabot-downloader/app/.venv/lib/python3.9/site-packages/telebot/util.py", line 92, in run
        task(*args, **kwargs)
      File "/home/pyinstabot-downloader/app/src/bot.py", line 329, in process_one_post
        telegram.send_styled_message(
      File "/home/pyinstabot-downloader/app/.venv/lib/python3.9/site-packages/telegram/telegram.py", line 171, in send_styled_message
        text=self.messages.render_template(
      File "/home/pyinstabot-downloader/app/.venv/lib/python3.9/site-packages/messages/messages.py", line 91, in render_template
        return template['text'].format(*arguments)
    IndexError: Replacement index 3 out of range for positional args tuple

Update PR template

# PR-1: NAME
**full changelog**: https://github.com/obervinov/messages-package/compare/v1.0.0...v1.0.1 by @ obervinov https://github.com/obervinov/messages-package/pull/1
## VERSION - YYYY-MM-DD
### What's Changed
#### πŸ› Bug Fixes
* 
* 
#### πŸ“š Documentation
* 
* 
#### πŸ’₯ Breaking Changes
* 
* 
#### πŸš€ Features
* 
* 

Update README.md

  • Add description of dependencies
  • Add examples and information about progressbar
  • Fix badge with tests in README.md

Correct dependabot form pip to poetry for building dependency graph

Check after a week, since dependabot runs once a week, this is an old log!!!
https://github.com/obervinov/messages-package/blob/main/.github/dependabot.yml

# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
  - package-ecosystem: "pip" # See documentation for possible values
    directory: "/" # Location of package manifests
    schedule:
      interval: "weekly"
Π‘Π½ΠΈΠΌΠΎΠΊ экрана 2024-01-20 Π² 13 55 16

Update GitHub Actions workflow

  • Tests and checks workflow - run on the main branch for the show badge
  • Add workflow with package installation verification (by tag, branch, default)
  • Merge all workflows to single file
    name: Test, Build and create relese
    
    on:
      push:
        branches:    
          - '*'
          - '*/*'
          - '**'
    
    env:
      PROJECT_DESCRIPTION: "This project is a telegram bot that allows you to create backups of content from your Instagram profile to Dropbox or Mega clouds, as well as in the local file system."
    
    
    jobs:
      pylint:
        uses: obervinov/_templates/.github/workflows/[email protected]
      verify-changelog:
        uses: obervinov/_templates/.github/workflows/[email protected]
      pytest:
        uses: obervinov/_templates/.github/workflows/[email protected]
      build-release:
        uses: obervinov/_templates/.github/workflows/build.docker.yml@release/v1.0.5
        needs: [pylint, verify-changelog, pytest]
  • Fix the error that caused the workflow create_release to run twice - at pr/main

Soft handling of situations where a configuration file or alias does not exist

  • configs.json does not exist

    =========================== short test summary info ============================
    ERROR tests/test_create_inline_markup.py::test_extract_token - FileNotFoundError: [Errno 2] No such file or directory: 'configs/messages.json'
    ERROR tests/test_create_inline_markup.py::test_create_inline_markup_3 - FileNotFoundError: [Errno 2] No such file or directory: 'configs/messages.json'
    ERROR tests/test_create_inline_markup.py::test_create_inline_markup_4 - FileNotFoundError: [Errno 2] No such file or directory: 'configs/messages.json'
  • alias not found
    just send error in the log message

  • configs.json is empty

    =========================== short test summary info ============================
    ERROR tests/test_create_inline_markup.py::test_extract_token - json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
    ERROR tests/test_create_inline_markup.py::test_create_inline_markup_3 - json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
    ERROR tests/test_create_inline_markup.py::test_create_inline_markup_4 - json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Update Tests

  • Delete a block in tests if "__name__" == "__main__" they are not actually used. Pytest runs the functions itself.

Fix typos in README.md

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.