moin icon indicating copy to clipboard operation
moin copied to clipboard

how to install moin2 from test.pypi

Open RogerHaase opened this issue 3 years ago • 3 comments

Every developer should install moin2 from github. For wiki admins who cannot, there is a packaging test on https://test.pypi.org/project/moin/

Moin on test.pypi gets updated as a test on an irregular basis. Cloning from github is a better choice.

<python> -m venv </path/to/new/virtual/environment>
cd </path/to/new/virtual/environment>
source bin/activate  # scripts\activate on windows
pip install --upgrade pip  # next command fails with pip 9.0.1 and maybe later versions
pip install --pre --index-url https://test.pypi.org/simple --extra-index-url https://pypi.org/simple moin
moin create-instance --path <path/to/new/wikiconfig/dir>  # path optional, defaults to CWD
cd <path/to/new/wikiconfig/dir>  # skip if using default CWD
moin --help  # prove it works

moin index-create -s -i  # creates empty wiki
-- or --
moin index-create -s -i  # creates empty wiki
moin load-sample  # data but no index
moin index-build  # data with index
-- or --
moin import19 --data_dir <path-to-moin-1.9/wiki/data -s -i > import19.txt  # review import19.txt for errors
moin index-build  # data with index

moin run --port 8080  # default port is 8080, point browser to http://127.0.0.1:8080

P.S.

  • you should have reviewed and updated wikiconfig.py
  • default start is Home, not FrontPage

RogerHaase avatar Feb 25 '22 21:02 RogerHaase

Can I add the command pip install --pre --index-url https://test.pypi.org/simple --extra-index-url https://pypi.org/simple moin to docs/admin/install.rst in addition to some other smaller fixes? This can help new interested people.

UlrichB22 avatar Jul 03 '22 21:07 UlrichB22

Sure, I will update test.pypi in a few days. I have no auth to update moin on pypi.

RogerHaase avatar Jul 04 '22 16:07 RogerHaase

Uploaded moin 2.0.0a11 to testpypi

RogerHaase avatar Jul 04 '22 21:07 RogerHaase

I am trying to install moin2 from source code in folder ~/moin. Ubuntu 22.04, python3.10.6 $ ./m quickinstall Running quickinstall.py... output messages redirected to m-quickinstall.txt

Searching m-quickinstall.txt, important messages are shown below... Do "./m log quickinstall" to see complete log.

3 Preparing metadata (setup.py): finished with status 'error' 4 error: subprocess-exited-with-error 6 × python setup.py egg_info did not run successfully. 18 Traceback (most recent call last): 40 raise LookupError( 41 LookupError: setuptools-scm was unable to detect version for /home/rudi/moin. 48 note: This error originates from a subprocess, and is likely not a problem with pip. 49 error: metadata-generation-failed 51 × Encountered error while generating package metadata. 56 Traceback (most recent call last): 64 raise CalledProcessError(retcode, cmd) 65 subprocess.CalledProcessError: Command '['/home/rudi/moin-venv-python3/bin/pip', 'install', '--upgrade', '--editable', '/home/rudi/moin', '--upgrade-strategy=eager']' returned non-zero exit status 1. Quickinstall run time (h:mm:ss) 0:00:03

What I am doing wrong? I am trying to install moin2 from source code in folder ~/moin. Ubuntu 22.04, python3.10.6 $ ./m quickinstall Running quickinstall.py... output messages redirected to m-quickinstall.txt

Searching m-quickinstall.txt, important messages are shown below... Do "./m log quickinstall" to see complete log.

3 Preparing metadata (setup.py): finished with status 'error' 4 error: subprocess-exited-with-error 6 × python setup.py egg_info did not run successfully. 18 Traceback (most recent call last): 40 raise LookupError( 41 LookupError: setuptools-scm was unable to detect version for /home/rudi/moin. 48 note: This error originates from a subprocess, and is likely not a problem with pip. 49 error: metadata-generation-failed 51 × Encountered error while generating package metadata. 56 Traceback (most recent call last): 64 raise CalledProcessError(retcode, cmd) 65 subprocess.CalledProcessError: Command '['/home/rudi/moin-venv-python3/bin/pip', 'install', '--upgrade', '--editable', '/home/rudi/moin', '--upgrade-strategy=eager']' returned non-zero exit status 1. Quickinstall run time (h:mm:ss) 0:00:03

What I am doing wrong? Is there a HowTo to install moin2? Rudi

rudi48 avatar Oct 14 '22 10:10 rudi48

Please check this documentation, there are two sections Installation and Installation (for developers): https://moin-20.readthedocs.io/en/latest/admin/install.html

Thanks for trying moin2, Ulrich

UlrichB22 avatar Oct 14 '22 10:10 UlrichB22

Hello UlrichB22,

Thank you very much for your for your quick answer.

Yes. I have read https://moin-20.readthedocs.io/en/latest/admin/install.html carefully. e.g.: $ apt install moin2 # that does not work

$ pip install --pre --index-url https://test.pypi.org/simple --extra-index-url https://pypi.org/simple moin That worked, otherwise I coud not call: $ ./m quickinstall # in folder ~/moin/

So, for me it is still mysterious.

Greetings, Rudi

rudi48 avatar Oct 14 '22 11:10 rudi48

The command in output line 65 fails. Can you run it directly to get more details on the error?

/home/rudi/moin-venv-python3/bin/pip install --upgrade --editable /home/rudi/moin --upgrade-strategy=eager

UlrichB22 avatar Oct 14 '22 14:10 UlrichB22

/home/rudi/moin-venv-python3/bin/pip install --upgrade --editable /home/rudi/moin --upgrade-strategy=eager Obtaining file:///home/rudi/moin Preparing metadata (setup.py) ... error error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully. │ exit code: 1 ╰─> [37 lines of output] /home/rudi/moin-venv-python3/lib/python3.10/site-packages/setuptools/installer.py:27: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer. warnings.warn( WARNING: The wheel package is not available. WARNING: The wheel package is not available. WARNING: The wheel package is not available. WARNING: The wheel package is not available. WARNING: The wheel package is not available. /usr/lib/python3.10/distutils/dist.py:274: UserWarning: Unknown distribution option: 'message_extractors' warnings.warn(msg) Traceback (most recent call last): File "", line 2, in File "", line 34, in File "/home/rudi/moin/setup.py", line 139, in setup(**setup_args) File "/home/rudi/moin-venv-python3/lib/python3.10/site-packages/setuptools/init.py", line 153, in setup return distutils.core.setup(**attrs) File "/usr/lib/python3.10/distutils/core.py", line 108, in setup _setup_distribution = dist = klass(attrs) File "/home/rudi/moin-venv-python3/lib/python3.10/site-packages/setuptools/dist.py", line 459, in init _Distribution.init( File "/usr/lib/python3.10/distutils/dist.py", line 292, in init self.finalize_options() File "/home/rudi/moin-venv-python3/lib/python3.10/site-packages/setuptools/dist.py", line 837, in finalize_options ep(self) File "/home/rudi/moin-venv-python3/lib/python3.10/site-packages/setuptools/dist.py", line 858, in _finalize_setup_keywords ep.load()(self, ep.name, value) File "/home/rudi/moin/.eggs/setuptools_scm-7.0.5-py3.10.egg/setuptools_scm/integration.py", line 90, in version_keyword _assign_version(dist, config) File "/home/rudi/moin/.eggs/setuptools_scm-7.0.5-py3.10.egg/setuptools_scm/integration.py", line 62, in _assign_version _version_missing(config) File "/home/rudi/moin/.eggs/setuptools_scm-7.0.5-py3.10.egg/setuptools_scm/init.py", line 109, in _version_missing raise LookupError( LookupError: setuptools-scm was unable to detect version for /home/rudi/moin.

  Make sure you're either building from a fully intact git repository or PyPI tarballs. Most other sources (such as GitHub's tarballs, a git checkout without the .git folder) don't contain the necessary metadata and will not work.
  
  For example, if you're using pip, instead of https://github.com/user/proj/archive/master.zip use git+https://github.com/user/proj.git#egg=proj
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed

× Encountered error while generating package metadata. ╰─> See above for output.

note: This is an issue with the package mentioned above, not pip. hint: See above for details.

rudi48 avatar Oct 14 '22 14:10 rudi48

I checked on a fresh install on ubuntu 22.04 desktop. After installation from test.pypi I could use moin --help and create an instance using moin command. There was no quickinstall.py, this is only for developers after installation from git. Please see also #907 .

UlrichB22 avatar Oct 14 '22 17:10 UlrichB22

Hello UlrichB22, Thank you very much for your extensive help. I have tried the command: $ cd ~/moin $ pip install --pre --index-url https://test.pypi.org/simple --extra-index-url https://pypi.org/simple moin There was a lot of checking, unfortunately the folder "moin" is still empty. :-(

Any further help please?

rudi48 avatar Oct 14 '22 18:10 rudi48

The moin software package goes somewhere into subdirectory .local in your home. I my case it is ~/.local/lib/python3.10/site-packages/moin/ . You don't need to care about that because it is for wiki users who don't want to change the code.

To have the moin command available you may need to expand your PATH environment with ~/.local/bin using export PATH=$PATH:~/.local/bin

The empty ~/moin is ok. If you change directory to it and run the moin create-instance command the wiki and its config will go there.

I run these commands to create a new wiki with English help pages and to start the builtin server:

moin create-instance 
moin index-create -s -i
moin load-help -n en
moin load-help -n common
moin run

UlrichB22 avatar Oct 14 '22 18:10 UlrichB22

Hello UlrichB22, Thank you very much for your extensive help.

Now moin2 works, big smile. http://127.0.0.1:8080/Home

I think your help should find a place in the "moin" documentation :-)

Is it possible to import the v1.9 wiki data into moin2, as provided in quickinstall.py ?

Greetings, Rudi

rudi48 avatar Oct 14 '22 18:10 rudi48

https://moin-20.readthedocs.io/en/latest/admin/upgrade.html?highlight=import19#importing-your-moin-1-9-data

RogerHaase avatar Oct 14 '22 19:10 RogerHaase

Hello Roger, Thank you very much for your help. The import of the moin-1.9.9 wiki worked. Unfortunately with a lot of errors, see: 96 -rw-rw-r-- 1 rudi rudi 96621 Okt 15 10:02 import19err.log 432 -rw-rw-r-- 1 rudi rudi 441011 Okt 15 10:03 import19out.log

I will attach 2 screenshots of a web page: from moin-1.9.9 and moin2 import

It looks to me, that there is a lot to do on the import filter. Regards, Rudi

AVRArduinoProMini_moin-1 9 9 Screenshot from 2022-10-15 11-42-42

rudi48 avatar Oct 15 '22 13:10 rudi48

Please open a new issue and include the raw 1.9 page content. Were there any error messages in the log?

The problem I see is the attachments did not get translated correctly (or not at all). Anything else?

RogerHaase avatar Oct 15 '22 14:10 RogerHaase

Hello Roger, I found no "moin" command to clear the moin2 wiki database. Does the attached moin-1.9.9 data archive of the page "AVRArduinoProMini" could help you? Regards, Rudi

AVRArduinoProMini.zip

rudi48 avatar Oct 16 '22 09:10 rudi48

Hello Roger, I tried the followingg:

$ mkdir moin2 $ cd ~/moin2 $ moin create-instance

$ moin import19 -s -i --data_dir ~/moin-1.9.9/wiki/data 1>import19out.log 2>import19err.log $ moin run In Firefox: http://127.0.0.1:8080/

pack folder moin2.zip

I hope it helps. Regards, Rudi

moin2.zip

rudi48 avatar Oct 16 '22 10:10 rudi48

There is no moin command to clear the moin2 wiki database. There is a todo to create the command somewhere.

For now, you must manually delete the /wiki/data/ and /wiki/index/ directories.

If you ran this command:

moin import19 -s -i --data_dir ~/moin-1.9.9/wiki/data 1>import19out.log 2>import19err.log

the output in import19err.log would be useful.

Create a new issue and post the error messages

RogerHaase avatar Oct 17 '22 16:10 RogerHaase

The translated languages are not displayed if moin is installed from test.pypi.org. The pypi package does not contain the compiled catalog files, e.g. src/moin/translations/de/LC_MESSAGES/messages.mo.

If moin is installed from git the catalog is compiled by quickinstall. IMO we should avoid the need to have compile_catalog run by users and add the compiled files as package_data.

UlrichB22 avatar Aug 08 '23 21:08 UlrichB22

agree; adding include src/moin/translations/*/LC_MESSAGES/messages.mo to MANIFEST.in` seems to fix it.

Will submit a pull request.

RogerHaase avatar Aug 10 '23 17:08 RogerHaase

Nothing left to do here, Installing moin from test.pypi.org included in docs/admin/install.rst

RogerHaase avatar Aug 23 '23 20:08 RogerHaase