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

Develop a system for zero-config project management #1

Open
7 of 9 tasks
jaraco opened this issue May 2, 2024 · 5 comments
Open
7 of 9 tasks

Develop a system for zero-config project management #1

jaraco opened this issue May 2, 2024 · 5 comments

Comments

@jaraco
Copy link
Member

jaraco commented May 2, 2024

@jaraco
Copy link
Member Author

jaraco commented May 2, 2024

One challenge I've identified is installing from GitHub source or other source directory. If a project doesn't have a pyproject.toml, pip has no idea about how to build it:

 @ pip-run git+https://github.com/jaraco/tempora@experiment/coherent
ERROR: git+https://github.com/jaraco/tempora@experiment/coherent does not appear to be a Python project: neither 'setup.py' nor 'pyproject.toml' found.
Traceback (most recent call last):
  File "/opt/homebrew/bin/pip-run", line 8, in <module>
    sys.exit(run())
             ^^^^^
  File "/opt/homebrew/lib/python3.12/site-packages/pip_run/__init__.py", line 13, in run
    with deps.load(*deps.not_installed(pip_args)) as home:
  File "/opt/homebrew/Cellar/[email protected]/3.12.3/Frameworks/Python.framework/Versions/3.12/lib/python3.12/contextlib.py", line 137, in __enter__
    return next(self.gen)
           ^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.12/site-packages/pip_run/deps.py", line 100, in load
    subprocess.check_call(cmd, env=env)
  File "/opt/homebrew/Cellar/[email protected]/3.12.3/Frameworks/Python.framework/Versions/3.12/lib/python3.12/subprocess.py", line 413, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '('/opt/homebrew/opt/[email protected]/bin/python3.12', '-m', 'pip', 'install', '-t', PosixPath('/var/folders/f2/2plv6q2n7l932m2x004jlw340000gn/T/pip-run-hky8fqrm'), 'git+https://github.com/jaraco/tempora@experiment/coherent')' returned non-zero exit status 1.

We could require each project to have the minimal pyproject.toml, but that becomes a shared artifact that needs to be managed across projects. Is there another way that a tool like pip or uv could infer those settings? Or get them from environment variables?

@jaraco
Copy link
Member Author

jaraco commented May 5, 2024

Another issue these projects will face - how to manage development environment defaults, such as setting the recommended defaults for ruff?

Perhaps the system should follow the same principle as skeleton did for .gitignore - that is, it should be defined somewhere at a system level or environment level.

Or maybe there should be a parent repo that contains the relevant projects and that repo should contain the ruff defaults. Something like:

py / coherent / build

Where py is coherent-oss/python and would contain the settings for all Python projects such as ruff best practices (and could contain projects outside coherent-oss). coherent is coherent-oss/coherent (?) and would contain settings or concerns specific to projects using the coherent namespace. And build is coherent-oss/coherent.build.

@jaraco
Copy link
Member Author

jaraco commented May 5, 2024

Ugh. It appears as if ruff only allows for discovering settings from one file. That file can explicitly include other files, but there's no support for composition (like git's global/user/local hierarchy). I think what this means is that anything that runs linting (including an editor that's autosaving, a pre-commit hook, a check at test time, or a manually-invoked formatting/lint operation) will have to be aware of the common config in order to honor it.

@jaraco
Copy link
Member Author

jaraco commented May 7, 2024

(moved to coherent-oss/coherent.test#1)

@jaraco
Copy link
Member Author

jaraco commented Jun 20, 2024

Thusfar, the builder is working for all of the coherent projects (coherent.build, coherent.test, and coherent.cli at the time of this writing). It's also working for tempora in the experimental branch. Therefore, I'm declaring "prove the builder" done.

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

1 participant