Skip to content

Commit

Permalink
update CONTRIBUTING
Browse files Browse the repository at this point in the history
  • Loading branch information
neolynx committed Dec 3, 2024
1 parent 8cf1e31 commit 8ac7ef2
Showing 1 changed file with 17 additions and 44 deletions.
61 changes: 17 additions & 44 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,13 @@ make docker-build

To run aptly commands in the development docker container, run:
```
make docker-aptly
make docker-shell
```

Example:
```
$ make docker-aptly
bash: cannot set terminal process group (16): Inappropriate ioctl for device
bash: no job control in this shell
aptly@b43e8473ef81:/app$ aptly version
$ make docker-shell
aptly@b43e8473ef81:/work/src$ aptly version
aptly version: 1.5.0+189+g0fc90dff
```

Expand Down Expand Up @@ -152,41 +150,36 @@ Run `make help` for more information.

This section describes local setup to start contributing to aptly.

#### Go & Python
#### Dependencies

You would need `Go` (latest version is recommended) and `Python` 3.9 (or newer, the CI currently tests against 3.11).
Building aptly required go version 1.22.

If you're new to Go, follow [getting started guide](https://golang.org/doc/install) to install it and perform
initial setup. With Go 1.8+, default `$GOPATH` is `$HOME/go`, so rest of this document assumes that.
On Debian bookworm with backports enabled go can be installed with:

Usually `$GOPATH/bin` is appended to your `$PATH` to make it easier to run built binaries, but you might choose
to prepend it or to skip this test if you're security conscious.
apt install -t bookworm-backports golang-go

#### Dependencies
#### Building

You would need some additional tools and Python virtual environment to run tests and checks, install them with:
Export GOPATH:

make prepare dev system/env
export GOPATH=~/go

This is usually one-time action.
To build aptly, run:

Aptly is using Go modules to manage dependencies, download modules using:
make build

make modules
To install aptly into `$GOPATH/bin`, run:

#### Building
make install

If you want to build aptly binary from your current source tree, run:
Add go binaries to your PATH if needed:

make install
export PATH=$PATH:$GOPATH/bin

This would build `aptly` in `$GOPATH/bin`, so depending on your `$PATH`, you should be able to run it immediately with:
Run aptly:

aptly

Or, if it's not on your path:

~/go/bin/aptly

#### Unit-tests

Expand Down Expand Up @@ -244,26 +237,6 @@ There are some packages available under `system/files/` directory which are used
this default location. You can run aptly under different user or by using non-default config location with non-default
aptly root directory.

#### Style Checks

Style checks could be run with:

make check

aptly is using [golangci-lint](https://github.com/golangci/golangci-lint) to run style checks on Go code. Configuration
for the linter could be found in [.golangci.yml](.golangci.yml) file.

Python code (system tests) are linted with [flake8 tool](https://pypi.python.org/pypi/flake8).

#### Vendored Code

aptly is using Go vendoring for all the libraries aptly depends upon. `vendor/` directory is checked into the source
repository to avoid any problems if source repositories go away. Go build process will automatically prefer vendored
packages over packages in `$GOPATH`.

If you want to update vendored dependencies or to introduce new dependency, use [dep tool](https://github.com/golang/dep).
Usually all you need is `dep ensure` or `dep ensure -update`.

### man Page

aptly is using combination of [Go templates](http://godoc.org/text/template) and automatically generated text to build `aptly.1` man page. If either source
Expand Down

0 comments on commit 8ac7ef2

Please sign in to comment.