Skip to content

Commit

Permalink
Update README after first release on PyPI
Browse files Browse the repository at this point in the history
  • Loading branch information
paugier committed Dec 17, 2024
1 parent 4f5064b commit 294e823
Showing 1 changed file with 66 additions and 34 deletions.
100 changes: 66 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,70 +5,93 @@
[![Heptapod CI](https://foss.heptapod.net/fluiddyn/hg-setup/badges/branch/default/pipeline.svg)](https://foss.heptapod.net/fluiddyn/hg-setup/-/pipelines)
[![Github Actions](https://github.com/fluiddyn/hg-setup/actions/workflows/ci.yml/badge.svg?branch=branch/default)](https://github.com/fluiddyn/hg-setup/actions)

hg-setup can be used to setup [Mercurial]. The main command provided by this package,
`hg-setup init` launches a simple Terminal User Interface (TUI) to initialize a
reasonable user configuration file and shell completion for bash and zsh.

With [UV], one can run it without installation with:

```sh
uvx hg-setup init
```

## Background

Mercurial is a Python application using C and Rust extensions. It is extendable with
[Mercurial] is a Python application using C and Rust extensions. It is extendable with
Mercurial extensions and two Python packages provide very useful Mercurial extensions
that most users should use : hg-git (Mercurial extension hggit) and hg-evolve (Mercurial
extensions topic and evolve).
that most users should use : [hg-git] (Mercurial extension hggit) and [hg-evolve]
(Mercurial extensions topic and evolve).

These things are packaged in 3 PyPI packages (associated with their equivalent
conda-forge packages): mercurial, hg-git, hg-evolve.
conda-forge packages): mercurial, hg-git, hg-evolve. Moreover, to use Mercurial
extensions, one has to write few lines in a configuration file (~/.hgrc).

To use Mercurial extensions, one has to write few lines in a configuration file
(~/.hgrc).

Mercurial with hg-git and hg-evolve is great but it is a bit difficult to setup. hg-setup
is there to help people to start with Mercurial and finalize its installation.
Mercurial with hg-git and hg-evolve is great but it is a bit difficult to setup for
beginners. hg-setup is there to help people to start with Mercurial and finalize its
installation.

## Install

Currently, only installation from source works.
Here, we give commands to install altogether and in an isolated environment Mercurial,
its more useful extensions ([hg-git] and [hg-evolve]) and hg-setup.

### From the package on PyPI

- With [pipx]

```sh
pipx install hg-setup@hg+https://foss.heptapod.net/fluiddyn/hg-setup
pipx install mercurial
pipx inject mercurial hg-git hg-evolve hg-setup
```

For development installation, see the file [CONTRIBUTING.md](./CONTRIBUTING.md).
- With [UV]

### My plans
```sh
uv tool install mercurial --with hg-git --with hg-evolve --with hg-setup
```

I hope that ultimately hg-setup can be installed automatically with Mercurial when
running install commands like:
### From the conda-forge package

**Soon**, there will be a conda-forge package, and one will be able to install Mercurial,
hg-git, hg-evolve and hg-setup by running:

- with [Miniforge] and [conda-app]

```sh
# from PyPI
pipx install mercurial[full]
uv tool install mercurial[full]
# with Miniforge (conda-forge) and conda-app (https://foss.heptapod.net/fluiddyn/conda-app)
conda activate base
pip install conda-app
conda-app install mercurial
# this requires optional deps on conda-forge
pixi global install mercurial[full]
```

However, we are not yet there. Nevertheless, this will work very soon (once hg-setup is
on PyPI)
- With [Pixi]

```sh
pipx install mercurial
pipx inject mercurial hg-git hg-evolve hg-setup
# or
uv tool install mercurial --with hg-git --with hg-evolve --with hg-setup
pixi global install mercurial-app
# or (equivalent)
pixi global install mercurial --with hg-git --with hg-evolve --with hg-setup
```

and this will work soon (once hg-setup is on conda-forge and mercurial-app has been
modified).
### From source

```sh
conda-app install mercurial
pixi global install mercurial-app
pixi global install mercurial --with hg-git --with hg-evolve --with hg-setup
pipx install hg-setup@hg+https://foss.heptapod.net/fluiddyn/hg-setup
```

Note that this will soon work too, independently of how Mercurial is installed:
For development installation, see the file [CONTRIBUTING.md](./CONTRIBUTING.md).

### My plans

I hope that ultimately hg-setup can be installed automatically with Mercurial when
running install commands like:

```sh
uvx hg-setup init
# from PyPI
pipx install mercurial[full]
uv tool install mercurial[full]
# with Miniforge (conda-forge) and conda-app
conda-app install mercurial
# this would require optional deps on conda-forge
pixi global install mercurial[full]
```

## User interfaces
Expand All @@ -92,3 +115,12 @@ The shell completion for bash and zsh can be initialized with:
hg-setup init-shell-completion bash
hg-setup init-shell-completion zsh
```

[conda-app]: https://foss.heptapod.net/fluiddyn/conda-app
[hg-evolve]: https://foss.heptapod.net/mercurial/evolve
[hg-git]: https://foss.heptapod.net/mercurial/hg-git
[mercurial]: https://www.mercurial-scm.org
[miniforge]: https://github.com/conda-forge/miniforge
[pipx]: https://pipx.pypa.io
[pixi]: https://pixi.sh
[uv]: https://docs.astral.sh/uv/

0 comments on commit 294e823

Please sign in to comment.