Skip to content

Commit

Permalink
Modernize buildsystem (#199)
Browse files Browse the repository at this point in the history
* flake.lock: Update

Flake lock file updates:

• Updated input 'flake-parts':
    'github:hercules-ci/flake-parts/59cf3f1447cfc75087e7273b04b31e689a8599fb' (2023-08-01)
  → 'github:hercules-ci/flake-parts/7f53fdb7bdc5bb237da7fefef12d099e4fd611ca' (2023-09-01)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/cf73a86c35a84de0e2f3ba494327cf6fb51c0dfd' (2023-08-10)
  → 'github:NixOS/nixpkgs/517501bcf14ae6ec47efd6a17dda0ca8e6d866f9' (2023-09-27)
• Updated input 'treefmt-nix':
    'github:numtide/treefmt-nix/19dee4bf6001849006a63f3435247316b0488e99' (2023-08-12)
  → 'github:numtide/treefmt-nix/720bd006d855b08e60664e4683ccddb7a9ff614a' (2023-09-27)

* nix-update: convert to pyproject

* drop old pkgs.nixVersions.stable fallback

* add create-release.sh script
  • Loading branch information
Mic92 authored Sep 30, 2023
1 parent e7208a4 commit 2732363
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 58 deletions.
38 changes: 38 additions & 0 deletions bin/create-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/usr/bin/env bash

set -eu -o pipefail

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
cd "$SCRIPT_DIR/.."

version=${1:-}
if [[ -z "$version" ]]; then
echo "USAGE: $0 version" >&2
exit 1
fi

if [[ "$(git symbolic-ref --short HEAD)" != "master" ]]; then
echo "must be on master branch" >&2
exit 1
fi

# ensure we are up-to-date
uncommitted_changes=$(git diff --compact-summary)
if [[ -n "$uncommitted_changes" ]]; then
echo -e "There are uncommitted changes, exiting:\n${uncommitted_changes}" >&2
exit 1
fi
git pull [email protected]:Mic92/nix-update master
unpushed_commits=$(git log --format=oneline origin/master..master)
if [[ "$unpushed_commits" != "" ]]; then
echo -e "\nThere are unpushed changes, exiting:\n$unpushed_commits" >&2
exit 1
fi
sed -i -e "s!^version = \".*\"\$!version = \"${version}\"!" pyproject.toml default.nix
git add pyproject.toml default.nix
nix flake check -vL
nix develop -c pytest -s .
git commit -m "bump version ${version}"
git tag -e "${version}"

echo "now run 'git push --tags origin master'"
7 changes: 5 additions & 2 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@


pkgs.python311.pkgs.buildPythonApplication {
name = "nix-update";
pname = "nix-update";
version = "0.19.3";
src = ./.;
format = "pyproject";
buildInputs = [ pkgs.makeWrapper ];
nativeBuildInputs = [ pkgs.python311.pkgs.setuptools ];
nativeCheckInputs = [
pkgs.python311.pkgs.pytest
# technically not test inputs, but we need it for development in PATH
pkgs.nixVersions.stable or pkgs.nix_2_4
pkgs.nixVersions.stable
pkgs.nix-prefetch-git
];
checkPhase = ''
Expand Down
18 changes: 9 additions & 9 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[project]
name = "nix-update"
description = "Swiss-knife for updating nix packages"
version = "0.19.3"
authors = [{ name = "Jörg Thalheim", email = "[email protected]" }]
license = { text = "MIT" }
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Topic :: Utilities",
"Intended Audience :: Developers",
]

[project.urls]
Homepage = "https://github.com/Mic92/nix-update"

[project.scripts]
nix-update = "nix_update:main"

[tool.ruff]
target-version = "py311"
line-length = 88
Expand All @@ -7,6 +30,7 @@ ignore = [ "E501" ]

[tool.mypy]
python_version = "3.11"
pretty = true
warn_redundant_casts = true
disallow_untyped_calls = true
disallow_untyped_defs = true
Expand Down
42 changes: 0 additions & 42 deletions setup.cfg

This file was deleted.

5 changes: 0 additions & 5 deletions setup.py

This file was deleted.

0 comments on commit 2732363

Please sign in to comment.