Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: No fixed objects #14

Closed
wants to merge 2 commits into from

Conversation

regulad
Copy link
Contributor

@regulad regulad commented Nov 23, 2023

Allows the library to be used with custom prometheus registries && more portable code

@Apollo-Roboto
Copy link
Owner

Thanks for the contribution!

Please separate the dependency changes into another pull request so I can merge it sooner. That part looks good :)

Also, can you provide more context or explanations about your changes. I'd like to understand your motivations a bit better.

@regulad
Copy link
Contributor Author

regulad commented Nov 25, 2023

The code changes are dependent on the dependency changes. Previously, in version v0.1.*, only once instance of the Prometheus Cog could be instantiated and it would always use the default Prometheus registry. This is problematic as in one interpreter you may want more than one discord bot each with their own prometheus cog and you may need to make a custom endpoint with fastapi-prometheus-instrumentator for example that requires a separate registry for each instance of the bot.

@regulad
Copy link
Contributor Author

regulad commented Nov 25, 2023

You may want to consider installing pre-commit and a poetry auto-exporter to maintain compatibility with your existing test framework. Using poetry, a pre-commit config such as the following would be sufficient.

repos:
-   repo: https://github.com/python-poetry/poetry
    rev: ''  # add version here
    hooks:
    -   id: poetry-export
        args: ["-f", "requirements.txt"]
        verbose: true
    - id: poetry-export
      args: [ "--dev", "-f", "requirements.txt", "-o", "requirements.txt" ]

This would force git to create a new requirements.txt that is synced with the pyproject.toml on commit.

I am unsure if a similar plugin exists for Hatch/Hatchling, as I am unable to find any documentation of any exporting features.

@regulad regulad marked this pull request as draft November 25, 2023 14:36
@regulad regulad marked this pull request as ready for review November 25, 2023 14:36
@regulad
Copy link
Contributor Author

regulad commented Nov 25, 2023

Once you find these changes suitable and make any required changes to dependency management/packaging please feel free to mark this PR as ready for review and merge it.

@Apollo-Roboto
Copy link
Owner

I'd like pull requests to focus on one feature at a time thank you.

If you'd like to, please open an issue to suggest the use of custom Prometheus registries.

I'll close this pull request because it introduces too many changes. Many of which I don't agree with (removal of the optional logging handler, new and removed metrics).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants