Skip to content
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

how to install moin2 from test.pypi #1197

Closed
RogerHaase opened this issue Feb 25, 2022 · 21 comments
Closed

how to install moin2 from test.pypi #1197

RogerHaase opened this issue Feb 25, 2022 · 21 comments

Comments

@RogerHaase
Copy link
Member

RogerHaase commented Feb 25, 2022

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   # creates empty wiki
-- or --
moin index-create   # 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 > import19.txt  # review import19.txt for errors
moin index-build  # data with index

moin load-help -n en
moin load-help -n common
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

If you want to start over with different wiki data, there is no moin command to clear the moin2 wiki database. For now, you must manually delete the /wiki/data/ and /wiki/index/ directories.

@UlrichB22
Copy link
Collaborator

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.

@RogerHaase
Copy link
Member Author

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

@RogerHaase
Copy link
Member Author

Uploaded moin 2.0.0a11 to testpypi

@rudi48
Copy link

rudi48 commented Oct 14, 2022

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

@UlrichB22
Copy link
Collaborator

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

@rudi48
Copy link

rudi48 commented Oct 14, 2022

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

@UlrichB22
Copy link
Collaborator

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

@rudi48
Copy link

rudi48 commented Oct 14, 2022

/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.

@UlrichB22
Copy link
Collaborator

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 .

@rudi48
Copy link

rudi48 commented Oct 14, 2022

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?

@UlrichB22
Copy link
Collaborator

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

@rudi48
Copy link

rudi48 commented Oct 14, 2022

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
Copy link

rudi48 commented Oct 15, 2022

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

@RogerHaase
Copy link
Member Author

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?

@rudi48
Copy link

rudi48 commented Oct 16, 2022

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
Copy link

rudi48 commented Oct 16, 2022

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

@RogerHaase
Copy link
Member Author

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

@UlrichB22
Copy link
Collaborator

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.

@RogerHaase
Copy link
Member Author

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

Will submit a pull request.

RogerHaase added a commit to RogerHaase/moin that referenced this issue Aug 10, 2023
RogerHaase added a commit that referenced this issue Aug 11, 2023
add translations to pypi packaging #1197
@RogerHaase
Copy link
Member Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants