osl-incubator / sugar

Simplify the usage of containers
https://osl-incubator.github.io/sugar/
BSD 3-Clause "New" or "Revised" License
7 stars 8 forks source link

Move from flat layout approach to src layout #91

Closed xmnlab closed 11 months ago

xmnlab commented 1 year ago

ref: https://osl-incubator.github.io/scicookie/guide.html#project-layout

joel5vega commented 1 year ago

It seems to be in src layout, how should we address this issue? image

xmnlab commented 1 year ago

As you can see, there is no src folder. So, this is a flat layout, where typically source files are in a folder called with the same name of the package in the root of the project.

To convert that to src layout, basically:

  1. Create a src folder in the root of the project
  2. move containers_sugar to src
  3. Update pyproject.toml

Verify in the code any place that is using the path containers_sugar/ and replace by the new path

Some references:

xmnlab commented 1 year ago

Let me know if you need more details ou explanations please

joel5vega commented 1 year ago

I did the changes in this file: image But I am not able to pass the precommit stage.

image Checking with the examples it seems to have a similar configuration image What can be the problem?

xmnlab commented 1 year ago

The git commit command is running the pre commit under the hood. The pre-commit command runs a bunch of tools. But you are using the base conda environment, and you probably don't have that tools installed there.

First activate your conda environment for sugar. That should do the trick.

xmnlab commented 1 year ago

@joel5vega , we just merged a PR for the same purpose for makim here: https://github.com/osl-incubator/makim/pull/63/files you can use that as a reference

joel5vega commented 1 year ago

image I have updated this in commit 1580480 from my fork. i think it will be visible in my next PR