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

Refactor project structure and update script namespaces. #80

Merged
merged 1 commit into from
Dec 20, 2024

Conversation

deeprave
Copy link
Owner

@deeprave deeprave commented Dec 20, 2024

  • Moved scripts and related resources under the envex namespace
  • Updated imports and pyproject.toml to reflect the new structure.
  • Adjusted .env file loading logic to handle encoding explicitly.
  • Upgrade dependencies

Summary by Sourcery

Refactor project structure by moving scripts and resources under the "envex" namespace. Update script imports, pyproject.toml, and environment file loading logic.

Enhancements:

  • Explicitly handle encoding when loading .env files.

Tests:

  • Remove pytest markers from test cases.

- Moved scripts and related resources under the
 `envex` namespace
- Updated imports and `pyproject.toml` to reflect the new structure.
- Adjusted `.env` file loading logic to handle encoding explicitly.
- Upgrade dependencies
Copy link
Contributor

sourcery-ai bot commented Dec 20, 2024

Reviewer's Guide by Sourcery

This pull request refactors the project structure by moving scripts and related resources under the "envex" namespace. It also updates the pyproject.toml and import statements to reflect these changes. Additionally, the encoding for .env file loading is explicitly handled, and project dependencies are upgraded.

Sequence diagram for updated .env file loading process

sequenceDiagram
    participant Client
    participant DotEnv as dot_env.py
    participant FileSystem

    Client->>DotEnv: Load .env file
    DotEnv->>FileSystem: Open file
    FileSystem-->>DotEnv: Return file handle
    DotEnv->>DotEnv: Read file content
    DotEnv->>DotEnv: Check if content is string
    DotEnv->>DotEnv: Encode with specified encoding
    DotEnv->>DotEnv: Create BytesIO
    DotEnv->>DotEnv: Load stream into environ
    DotEnv-->>Client: Return processed environment
Loading

File-Level Changes

Change Details Files
Moved scripts and resources under the 'envex' namespace.
  • Moved scripts to the 'envex/scripts' directory.
  • Updated 'pyproject.toml' to reflect the new script locations.
  • Updated import statements in 'env2hvac.py'.
scripts/env2hvac.py
pyproject.toml
Explicitly handle .env file encoding.
  • Read data from the .env file and encode it using the specified encoding if it's a string.
envex/dot_env.py
Upgrade dependencies
  • Updated dependencies in 'uv.lock'.
uv.lock
Removed unit test markers
  • Removed unnecessary pytest markers ('@pytest.mark.unit') from test functions in 'tests/test_env_crypto.py'.
tests/test_env_crypto.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @deeprave - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Could you explain the rationale behind removing all the @pytest.mark.unit decorators from the tests? This change wasn't mentioned in the PR description and might affect test organization and CI pipelines.
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@deeprave deeprave merged commit 1876b27 into main Dec 20, 2024
7 checks passed
@deeprave deeprave deleted the move-scripts-and-fix-loader branch December 20, 2024 03:36
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.

1 participant