Skip to content

Commit

Permalink
Merge pull request #725 from kamadorueda/main
Browse files Browse the repository at this point in the history
New user interface
  • Loading branch information
kamadorueda committed Oct 11, 2021
2 parents 7a259b9 + af48ebd commit 677eedd
Show file tree
Hide file tree
Showing 8 changed files with 326 additions and 105 deletions.
1 change: 1 addition & 0 deletions .envrc
@@ -0,0 +1 @@
source "$(m . /dev/makes)/template"
9 changes: 0 additions & 9 deletions README.md
Expand Up @@ -576,15 +576,6 @@ you need to use the **same version**
of the framework and the CLI.
For example: `21.11`.

## Command-line completion

We currently have [Command-line Completion][CLI_COMPLETION] scripts
for the following shells:

- [Bash][BASH]:
Add this: `source <(m-comp-bash)`
to the end of your `~/.bashrc`

# Configuring CI/CD

## Providers comparison
Expand Down
80 changes: 33 additions & 47 deletions default.nix
Expand Up @@ -2,55 +2,41 @@
,
}:

with import ./src/args/agnostic.nix { inherit system; };

let
bin = makeScript {
aliases = [
"m-v21.11"
"makes"
"makes-v21.11"
];
replace = {
__argMakesSrc__ = ./.;
__argNixStable__ = __nixpkgs__.nixStable;
__argNixUnstable__ = __nixpkgs__.nixUnstable;
};
entrypoint = ''
__MAKES_REGISTRY__=__argMakesSrc__/src/cli/main/registry.json \
__MAKES_SRC__=__argMakesSrc__ \
__NIX_STABLE__=__argNixStable__ \
__NIX_UNSTABLE__=__argNixUnstable__ \
python -u __argMakesSrc__/src/cli/main/__main__.py "$@"
'';
searchPaths = {
bin = [
__nixpkgs__.cachix
__nixpkgs__.git
__nixpkgs__.gnutar
__nixpkgs__.gzip
__nixpkgs__.nixStable
__nixpkgs__.python38
];
pythonPackage38 = [
__nixpkgs__.python38Packages.pygments
__nixpkgs__.python38Packages.rich
];
};
name = "m";
args = import ./src/args/agnostic.nix { inherit system; };

inherit (args) __nixpkgs__;
inherit (args) makeScript;
in
makeScript {
aliases = [
"m-v21.11"
"makes"
"makes-v21.11"
];
replace = {
__argMakesSrc__ = ./.;
__argNixStable__ = __nixpkgs__.nixStable;
__argNixUnstable__ = __nixpkgs__.nixUnstable;
};
compBash = makeScript {
replace = {
__argCompBash__ = ./src/comp/bash.sh;
};
entrypoint = "cat __argCompBash__";
name = "m-comp-bash";
entrypoint = ''
__MAKES_REGISTRY__=__argMakesSrc__/src/cli/main/registry.json \
__MAKES_SRC__=__argMakesSrc__ \
__NIX_STABLE__=__argNixStable__ \
__NIX_UNSTABLE__=__argNixUnstable__ \
python -u __argMakesSrc__/src/cli/main/__main__.py "$@"
'';
searchPaths = {
bin = [
__nixpkgs__.cachix
__nixpkgs__.git
__nixpkgs__.gnutar
__nixpkgs__.gzip
__nixpkgs__.nixStable
];
source = [
(import ./makes/cli/pypi/main.nix args)
];
};
in
__nixpkgs__.symlinkJoin {
name = "m";
paths = [
bin
compBash
];
}
7 changes: 4 additions & 3 deletions makes.nix
Expand Up @@ -35,6 +35,9 @@
example = {
bin = [ inputs.nixpkgs.hello ];
};
makes = {
source = [ outputs."/cli/pypi" ];
};
};
envVars = {
example = {
Expand Down Expand Up @@ -109,9 +112,7 @@
lintPython =
let
searchPaths = {
pythonPackage38 = [
__nixpkgs__.python38Packages.rich
];
source = [ outputs."/cli/pypi" ];
};
in
{
Expand Down
7 changes: 7 additions & 0 deletions makes/cli/pypi/main.nix
@@ -0,0 +1,7 @@
{ makePythonPypiEnvironment
, ...
}:
makePythonPypiEnvironment {
name = "cli-pypi";
sourcesYaml = ./pypi-sources.yaml;
}
2 changes: 2 additions & 0 deletions makes/cli/pypi/pypi-deps.yaml
@@ -0,0 +1,2 @@
rich: "*"
textual: "*"
23 changes: 23 additions & 0 deletions makes/cli/pypi/pypi-sources.yaml
@@ -0,0 +1,23 @@
closure:
colorama: 0.4.4
commonmark: 0.9.1
pygments: 2.10.0
rich: 10.12.0
textual: 0.1.12
links:
- name: colorama-0.4.4-py2.py3-none-any.whl
sha256: 1qn3bnyd7gdwkyk8nvlhiy3c6zbwjd49fjxj0gp8xxi9faiysiwz
url: https://files.pythonhosted.org/packages/44/98/5b86278fbbf250d239ae0ecb724f8572af1c91f4a11edf4d36a206189440/colorama-0.4.4-py2.py3-none-any.whl
- name: commonmark-0.9.1-py2.py3-none-any.whl
sha256: 1nbgsvb73ad93cjzjdggkpp4zizvxay3q6ms23j3vy4h4p4khbys
url: https://files.pythonhosted.org/packages/b1/92/dfd892312d822f36c55366118b95d914e5f16de11044a27cf10a7d71bbbf/commonmark-0.9.1-py2.py3-none-any.whl
- name: Pygments-2.10.0-py3-none-any.whl
sha256: 1003l9kipymrk4n3nj8yxf5z1jr40q69gqmkqjrr5x3qmzk7zrmq
url: https://files.pythonhosted.org/packages/78/c8/8d9be2f72d8f465461f22b5f199c04f7ada933add4dae6e2468133c17471/Pygments-2.10.0-py3-none-any.whl
- name: rich-10.12.0-py3-none-any.whl
sha256: 0yzkqdmvbjsv0dzmikz6bpsvalrys63xblkvdbayygfds446h3f3
url: https://files.pythonhosted.org/packages/de/80/f8d5689d21e98e2d4397975969fb329b8e08aa31a15046fd32ef24279cc5/rich-10.12.0-py3-none-any.whl
- name: textual-0.1.12-py3-none-any.whl
sha256: 0xr4cn53pv5skzk0h4vqp97y3caisx5wnvcq4l534lyg0v6fk59g
url: https://files.pythonhosted.org/packages/12/95/330c20294045571906e2566fafbad2779f69e9605a05f70862cea7f81cec/textual-0.1.12-py3-none-any.whl
python: "3.9"

0 comments on commit 677eedd

Please sign in to comment.