Skip to content

Commit

Permalink
Unlock depends
Browse files Browse the repository at this point in the history
Testing it all still works with unlocked depends, adding a nix definition for reproducibility, adding python >3.8 compatibility.
  • Loading branch information
cransom committed Jun 25, 2024
1 parent 8efa92e commit 7521a19
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 12 deletions.
73 changes: 73 additions & 0 deletions default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{ lib
, python3
, fetchPypi
, fetchFromGitHub
}:
let
atomicwrites = python3.pkgs.buildPythonPackage rec {
pname = "atomicwrites";
version = "1.4.0";
pyproject = true;

src = fetchPypi {
inherit pname version;
hash = "sha256-rnA5atGkNPnHBG/S3RlvwEsS+ekf+4WRZBk76LYWino=";
};

nativeBuildInputs = [
python3.pkgs.setuptools
python3.pkgs.wheel
];

pythonImportsCheck = [ "atomicwrites" ];

meta = with lib; {
description = "Atomic file writes";
homepage = "https://pypi.org/project/atomicwrites/";
license = licenses.mit;
maintainers = with maintainers; [ ];
mainProgram = "atomicwrites";
};
};
in
python3.pkgs.buildPythonPackage rec {
pname = "zinc";
version = "unstable-2024-04-09";
pyproject = true;

src = ./.;
###################################################################
# src = fetchFromGitHub { #
# owner = "mindsnacks"; #
# repo = "Zinc"; #
# rev = "8efa92e4d9da30b5eb5c379abf64090f6833aec5"; #
# hash = "sha256-zjkv7SuulaQVWl2N1O/32An3nDMChR3JC+OYfYM58ZA="; #
# }; #
###################################################################

nativeBuildInputs = [
python3.pkgs.setuptools
python3.pkgs.wheel
];

propagatedBuildInputs = with python3.pkgs; [
setuptools
atomicwrites
boto3
jsonschema
lockfile
redis
requests
toml
];

pythonImportsCheck = [ "zinc" ];

meta = with lib; {
description = "Asset distribution system for mobile clients";
homepage = "https://github.com/mindsnacks/Zinc";
license = licenses.mit;
maintainers = with maintainers; [ ];
mainProgram = "zinc";
};
}
10 changes: 5 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
lockfile==0.9.1
boto3==1.26.160
lockfile
boto3
toml
requests
jsonschema==1.3.0
atomicwrites==1.3.0
redis==4.4.4
jsonschema
atomicwrites
redis
11 changes: 5 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@
# List your project dependencies here.
# For more details, see:
# http://packages.python.org/distribute/setuptools.html#declaring-dependencies
"toml==0.10.0",
"lockfile==0.9.1",
"boto3==1.26.160",
"atomicwrites==1.3.0",
"redis==4.4.4",
"jsonschema==1.3.0",
"toml",
"lockfile",
"boto3",
"atomicwrites",
"jsonschema",
]


Expand Down
7 changes: 6 additions & 1 deletion src/zinc/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,17 @@


import json
from collections import MutableMapping
import sys
from functools import wraps
from pkg_resources import resource_string
import jsonschema
from typing import Dict

if sys.version_info[:2] >= (3, 8):
from collections.abc import MutableMapping
else:
from collections import MutableMapping

from .defaults import defaults
from .pathfilter import PathFilter

Expand Down

0 comments on commit 7521a19

Please sign in to comment.