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

0.3.0 Release -- Major refactor and stability branch #8

Draft
wants to merge 24 commits into
base: main
Choose a base branch
from

Conversation

birdcar
Copy link
Owner

@birdcar birdcar commented Nov 21, 2021

The current release (0.2.2) is a proof of concept that was mostly so I could prove that this was an idea that could work. Now that that's done and I've had a few people express interest, the work that needs to be done is to make this a more robust, workable system. I'll be updating the body here as needed, but this is going to be a release branch meant to contain the bulk of the major refactor that needs to happen to make this a stable, usable tool for most people.

To-do

  • Support both conda and venv/pip based environments
    • venv / pip
    • conda
    • Bonus: ensure that it could be extended with additonal managers if there was interest in doing so (e.g. mamba, etc
  • Write tests for all environment managers
    • pip/venv
    • conda
  • Add an "opt-in configuration" system that allows for advanced users to automate their environment
    • Decide on a templating system (Done: it's Jinja2)
    • Decide on a standard location (Done: it's ~/.devwrangler on unix-based systems)
    • Create standard templates that we base our own defaults on
  • Create a composable CLI using Typer
    • Commands have been broken up so that they can be composed
    • Flags are used appropriately at the top level
    • User configuration is sourced appropriately
    • Unit and Integration tests exist for all commands
  • Write documentation
    • Update the README to explain the basics
    • Write a "Why Devwrangler" doc
    • Write a set of philosophical plumb-lines
    • Write good docstrings for each module, class, and function
    • Document the default system
    • Document the configuration system
    • Document the CLI flags and options for the terminal
    • Document the CLI flags and options for the docs

@birdcar birdcar self-assigned this Nov 21, 2021
The current version of the pydev command is designed as a proof of concept,
but isn't really extensible beyond my own personal preferences.

The solution to that, as I see it, is to create a common API for all current
and future supported environment managers to adhere to, which we can then
use as an abstract base class for future environment managers to use.
This may not be necessary, it appears that all of the 'local'
pyenv versions are available in all testenvs. However, in an
ideal world, this would allow us to run the tests associated
with a specific manager in a specific environment only.
As I was starting to work with and reason about the API for devwrangler
it occurred to me that we want things to be quiet by default. With that
in mind, it made more sense to make verbose logging *opt-in* rather than
allowing the 'quiet' flag to be *opt-out*.
It turns out that the old tmpdir fixture actually had a replacement
using the pathlib.Path object just like I wanted, and I didn't have
to create that fixture on my own. With that in mind, I can simplify
things considerably.
Ultimately, this basic check ensures that the manager itself:

1. Works (i.e. actually creates a conda environment where we expect it to)
2. Provides access to a default Python once the environment is created
@birdcar birdcar added the enhancement New feature or request label Jan 6, 2022
This was linked to issues Jan 6, 2022
@codecov
Copy link

codecov bot commented Jan 6, 2022

Codecov Report

Merging #8 (f89fcaf) into main (9bc1b56) will decrease coverage by 3.06%.
The diff coverage is 60.31%.

❗ Current head f89fcaf differs from pull request most recent head 9cf9a8a. Consider uploading reports for the commit 9cf9a8a to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##             main       #8      +/-   ##
==========================================
- Coverage   34.84%   31.78%   -3.07%     
==========================================
  Files           3        9       +6     
  Lines          66      129      +63     
  Branches       10       18       +8     
==========================================
+ Hits           23       41      +18     
- Misses         43       87      +44     
- Partials        0        1       +1     
Impacted Files Coverage Δ
devwrangler/utilities/logging.py 0.00% <0.00%> (ø)
devwrangler/managers/conda.py 41.17% <41.17%> (ø)
devwrangler/managers/venv.py 60.00% <60.00%> (ø)
devwrangler/utilities/shell.py 70.00% <70.00%> (ø)
devwrangler/managers/base.py 88.88% <88.88%> (ø)
devwrangler/managers/__init__.py 100.00% <100.00%> (ø)
devwrangler/devwrangler.py 0.00% <0.00%> (-41.67%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9bc1b56...9cf9a8a. Read the comment docs.

Copy link
Owner Author

@birdcar birdcar left a comment

Choose a reason for hiding this comment

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

Here are some notes

Comment on lines +24 to +30
$ pydev
$ pydev create
$ pydev create --env venv
$ pydev create --env conda
$ pyenv configure
$ pydev configure --editor vscode
$ pydev configure --editor vscode --extras django,jinja2
Copy link
Owner Author

Choose a reason for hiding this comment

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

This is a review comment

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

Successfully merging this pull request may close these issues.

Add Rich for terminal beauty Add Jinja 2 for templating
1 participant