-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pythonPackages.promnesia: init at 1.1.20230129 #215228
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First pass. A few changes that are required on all packages:
- We require running tests, when they're available
- if not available on pypi, we fetch from the git source
- We require explicit
nativeCheckInputs
, usuallypytestCheckHook
orunittestCheckHook
- We require a
format
set just belowversion
pyproject.toml
? thenpyproject
setup.py
?setuptools
- The fetcher should use
hash
, not the legacysha256
attribute
@@ -0,0 +1,25 @@ | |||
{ buildPythonPackage, fetchPypi, lib, appdirs, sqlalchemy, setuptools-scm }: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One argument per line, please.
|
||
buildPythonPackage rec { | ||
pname = "cachew"; | ||
version = "0.11.0"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
version = "0.11.0"; | |
version = "0.11.0"; | |
format = "setuptools"; |
We set an explicit format for python packages. This package uses a setup.py
, so it is setuptools
.
src = fetchPypi { | ||
inherit pname version; | ||
sha256 = "sha256-4qjgvffInKRpKST9xbwwC2+m8h3ups0ZePyJLUU+KhA="; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move the src below version and format.
Also did you notice that the pypi sdist does not contain tests? We should fetch from GitHub I think.
cachew> running test
cachew> WARNING: Testing via this command is deprecated and will be removed in a future version. Users looking for a generic test entry point independent of test runner are encouraged to use tox.
cachew> running egg_info
cachew> writing src/cachew.egg-info/PKG-INFO
cachew> writing dependency_links to src/cachew.egg-info/dependency_links.txt
cachew> writing requirements to src/cachew.egg-info/requires.txt
cachew> writing top-level names to src/cachew.egg-info/top_level.txt
cachew> reading manifest file 'src/cachew.egg-info/SOURCES.txt'
cachew> adding license file 'LICENSE.txt'
cachew> writing manifest file 'src/cachew.egg-info/SOURCES.txt'
cachew> running build_ext
cachew>
cachew> ----------------------------------------------------------------------
cachew> Ran 0 tests in 0.000s
cachew>
cachew> OK
cachew> Finished executing setuptoolsCheckPhase
Also tests are run implicitly, which is deprecated. The project uses pytest, and we can use pytestCheckHook
in checkInputs
after updating the src.
}: | ||
|
||
buildPythonPackage rec { | ||
pname = "HPI"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pname and attribute need to be normalized according to PEP0503. In this case that means lowercasing them.
sha256 = "sha256-cozMmfBF7D1qCZFjf48wRQaeN4MhdHAAxS8tGp/krK8="; | ||
}; | ||
|
||
nativeBuildInputs = [ setuptools-scm ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nativeBuildInputs = [ setuptools-scm ]; | |
nativeBuildInputs = [ | |
setuptools-scm | |
]; |
In python-modules we do expand all lists.
|
||
meta = with lib; { | ||
homepage = "https://github.com/karlicoss/promnesia"; | ||
description = "Another piece of your extended mind"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While that description
is what upstream is offering it is rather meaningless.
}: | ||
|
||
buildPythonPackage rec { | ||
pname = "promnesia"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a library or an application? We only keep libraries in python-modules
. Application need to be moved elsewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's both as far as I can tell - not sure how that changes the rules (if at all).. There is the command promnesia
, but the configuration uses it as a library: https://github.com/karlicoss/promnesia/blob/master/src/promnesia/misc/config_example.py
Maybe it's both?
propagatedBuildInputs = [ | ||
beautifulsoup4 | ||
cachew | ||
fastapi | ||
HPI | ||
httptools | ||
logzero | ||
lxml | ||
mistletoe | ||
more-itertools | ||
mypy | ||
orgparse | ||
pytz | ||
setuptools | ||
sqlcipher3 | ||
tzlocal | ||
urlextract | ||
uvicorn | ||
uvloop | ||
watchfiles | ||
websockets | ||
]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Separate out optional dependencies.
https://github.com/karlicoss/promnesia/blob/master/setup.py#L85
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then we also remove the linting dependencies which do not belong to propagatedBuildInputs
pkgs/top-level/python-packages.nix
Outdated
@@ -4376,6 +4378,8 @@ self: super: with self; { | |||
|
|||
hpccm = callPackage ../development/python-modules/hpccm { }; | |||
|
|||
HPI = callPackage ../development/python-modules/HPI { }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HPI = callPackage ../development/python-modules/HPI { }; | |
hpi = callPackage ../development/python-modules/hpi { }; |
doCheck = true; | ||
|
||
meta = with lib; { | ||
description = ""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing description
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The description that upstream uses is "Emacs org-mode parser in Python":
description = ""; | |
description = "Emacs org-mode parser in Python"; |
On 08.02.23 14:06, Aaron Bieber wrote:
***@***.**** commented on this pull request.
------------------------------------------------------------------------
In pkgs/development/python-modules/promnesia/default.nix
<#215228 (comment)>:
> +, mypy
+, orgparse
+, pytz
+, setuptools
+, setuptools-scm
+, sqlcipher3
+, tzlocal
+, urlextract
+, uvicorn
+, uvloop
+, watchfiles
+, websockets
+}:
+
+buildPythonPackage rec {
+ pname = "promnesia";
It's both as far as I can tell - not sure how that changes the rules (if
at all).. There is the command |promnesia|, but the configuration uses
it as a library:
https://github.com/karlicoss/promnesia/blob/master/src/promnesia/misc/config_example.py <https://github.com/karlicoss/promnesia/blob/master/src/promnesia/misc/config_example.py>
Maybe it's both?
—
Reply to this email directly, view it on GitHub
<#215228 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABAED32OPJ6V325VVMP7BLWWOK5TANCNFSM6AAAAAAUUVHGDM>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
If it exposes some library front end it can stay in python-modules, but
you likely also want to expose it with `toPythonApplication` in
top-level/all-packages.nix.
|
description = | ||
"Transparent and persistent cache/serialization powered by type hints"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
description = | |
"Transparent and persistent cache/serialization powered by type hints"; | |
description = "Transparent and persistent cache/serialization powered by type hints"; |
I am going to set this project asside for a bit..
@qbit any updates on this? |
I gave up after being (iirc) 10 new deps deep. There are also some issues upstream(s) are sorting out: pudo/dataset#415 |
IIRC the last commit had all of the deps that were needed for functionality - but they are missing the test deps (and probably other test deps) |
Ah, okay. This PR might merge a little faster if you split out some of the dependencies into other PRs. There are a few packages in here that don't have any issues and are probably ready for merge. Feel free to tag me on any PRs related to this. |
This add promnesia and its dependencies.
There are a few things I am not sure about:
$out/bin/hpi
, but it doesn't seem to be doing so.promnesia
runs aconfig.py
configuration that users create / modify. Currently, thatconfig.py
fails to loadHPI
(lib is namedmy
) and thepromnesia
lib when commands likepromnesia doctor
are used.CC @mweinelt
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)nixos/doc/manual/md-to-db.sh
to update generated release notes