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

QoL improvements for development #1500

Open
sheralim012 opened this issue Dec 30, 2022 · 1 comment
Open

QoL improvements for development #1500

sheralim012 opened this issue Dec 30, 2022 · 1 comment

Comments

@sheralim012
Copy link
Contributor

sheralim012 commented Dec 30, 2022

Tests

Most tests require a basic structure (pre-requisites) e.g., site, site settings, home page, etc. It would be better to create a mixin for it. It will remove a lot of duplications in the tests. Also, Django unit tests and selenium tests can use this. CSS selectors are another example that can be extracted and both Django and selenium tests can share.

Formatting

There are a few places where the code isn't formatted and it would be better to automate this task. I suggest we should integrate pre-commit for it. What this will do is before creating an actual commit either format the code or ask the user to resolve (if necessary).

Package management

As discussed in #1008

Documentation

Add technical documentation for non-obvious changes—for example, double header, top-level-section menu etc.

@sheralim012 sheralim012 changed the title Refactor Django unit tests QoL improvements for development Jan 23, 2023
@Alihassanc5
Copy link
Collaborator

Pip-tools:

Pros:

  • Provides a simple and easy-to-understand workflow for managing dependencies.
  • Can automatically update dependency versions using the pip-compile --upgrade command.
  • Supports multiple environments with different dependencies by using separate requirements files (dev, test, prod).

Suppose you have a Python project with several dependencies, and you want to manage them using pip-tools. You can create a requirements.in file, specify the dependencies and their versions, and then use the pip-compile command to generate a requirements.txt file. If you want to upgrade a dependency, you can run pip-compile --upgrade, and pip-tools will automatically update the version of the dependency in the requirements.txt file.

Cons:

  • Lacks the advanced features of a full-fledged package manager.
  • Requires manual maintenance of dependencies and version conflicts

Suppose you have two dependencies, A and B, that are required by your project. Dependency A requires version 1.0 of another package, while dependency B requires version 2.0 of the same package. If you add both dependencies to your requirements.in file, pip-compile will fail to generate a requirements.txt file because of the version conflict. You'll have to manually resolve the conflict by specifying a compatible version in the requirements.in file.

PDM:

Pros:

  • Provides a full-fledged package management system.
  • Can automatically resolve and install dependencies and version conflicts.
  • Supports multiple project environments with dependency isolation.
  • Supports both PyPI and Git repositories as sources for packages.

Suppose you have a large Python project with many dependencies, and you want to manage them using PDM. You can create a pyproject.toml file and specify the dependencies and their versions. PDM can automatically resolve and install the dependencies, taking care of version conflicts and other issues so you don't need to manually resolve the version conflicts as PDM will do it for you.. If you want to add a new dependency, you can use the PDM add command, and PDM will handle the installation and integration with your project.

Cons:

  • Has a steeper learning curve due to its advanced features.
  • May require additional configuration for more complex projects.

Suppose your project has a complex dependency tree with conflicting versions of some packages. PDM may require additional configuration to resolve the conflicts properly. You may have to manually specify the version of a package in your pyproject.toml file or use PDM's advanced features to customize the dependency resolution process (PDM can automatically resolve most dependencies, there may be cases where manual intervention is necessary).

Conclusion:

Pip-tools is a simpler, lightweight and more straightforward option for basic dependency management needs. Pip-tools would be a good choice for the IoGT project because it provides a simple and easy-to-understand workflow for managing dependencies, supports multiple environments with different dependencies by using separate requirements files, and can automatically update dependency versions using the pip-compile --upgrade command. It also has a large community and is widely used, making it a reliable choice.

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

No branches or pull requests

2 participants