All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-python][PATCH] python3-astor: fix VERSION file not found
@ 2020-01-02  8:52 Hongxu Jia
  0 siblings, 0 replies; only message in thread
From: Hongxu Jia @ 2020-01-02  8:52 UTC (permalink / raw)
  To: raj.khem; +Cc: openembedded-devel

...
import astor
  File "/usr/lib/python3.7/site-packages/astor/__init__.py", line 24, in <module>
    with open(os.path.join(ROOT, 'VERSION')) as version_file:
FileNotFoundError: [Errno 2] No such file or directory: '/usr/lib/python3.7/site-packages/astor/VERSION'
...

Place the value in a simple VERSION text file and have both setup.py and the
project code read it. With this approach you must make sure that the VERSION
file is included in all your source and binary distributions (e.g. add include
VERSION to your MANIFEST.in). [1]

[1] https://packaging.python.org/guides/single-sourcing-package-version/

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 ...f3ff7ad8818475b6e107e63aa9a54252d2a9.patch | 22 ++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)

diff --git a/meta-python/recipes-devtools/python/python3-astor/f820f3ff7ad8818475b6e107e63aa9a54252d2a9.patch b/meta-python/recipes-devtools/python/python3-astor/f820f3ff7ad8818475b6e107e63aa9a54252d2a9.patch
index 823699339..6d71be992 100644
--- a/meta-python/recipes-devtools/python/python3-astor/f820f3ff7ad8818475b6e107e63aa9a54252d2a9.patch
+++ b/meta-python/recipes-devtools/python/python3-astor/f820f3ff7ad8818475b6e107e63aa9a54252d2a9.patch
@@ -3,14 +3,27 @@ From: Jonathan Ringer <jonringer117@gmail.com>
 Date: Thu, 17 Oct 2019 16:54:16 -0700
 Subject: [PATCH] Fix packaging for setuptools>=41.4
 
+Upstream-Status: Pending
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
 ---
+ MANIFEST.in       |  1 +
  astor/VERSION     |  1 +
  astor/__init__.py |  5 ++++-
  setup.cfg         |  3 ++-
  setup.py          | 16 +---------------
- 4 files changed, 8 insertions(+), 17 deletions(-)
+ 5 files changed, 9 insertions(+), 17 deletions(-)
  create mode 100644 astor/VERSION
 
+diff --git a/MANIFEST.in b/MANIFEST.in
+index b12a6fe..81e72d5 100644
+--- a/MANIFEST.in
++++ b/MANIFEST.in
+@@ -1,3 +1,4 @@
+ include README.rst AUTHORS LICENSE CHANGES
+ include setuputils.py
++include astor/VERSION
+ recursive-include tests *.py
 diff --git a/astor/VERSION b/astor/VERSION
 new file mode 100644
 index 0000000..a3df0a6
@@ -22,7 +35,7 @@ diff --git a/astor/__init__.py b/astor/__init__.py
 index 3b02983..8dfcdb1 100644
 --- a/astor/__init__.py
 +++ b/astor/__init__.py
-@@ -9,6 +9,7 @@
+@@ -9,6 +9,7 @@ Copyright 2013 (c) Berker Peksag
  
  """
  
@@ -30,7 +43,7 @@ index 3b02983..8dfcdb1 100644
  import warnings
  
  from .code_gen import SourceGenerator, to_source  # NOQA
-@@ -19,7 +20,9 @@
+@@ -19,7 +20,9 @@ from .op_util import get_op_symbol, get_op_precedence  # NOQA
  from .op_util import symbol_data  # NOQA
  from .tree_walk import TreeWalk  # NOQA
  
@@ -85,3 +98,6 @@ index 4a111b5..6068493 100644
  
 -setup(**config['options'])
 +setup()
+-- 
+2.21.0
+
-- 
2.21.0



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-01-02  8:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-02  8:52 [meta-python][PATCH] python3-astor: fix VERSION file not found Hongxu Jia

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.