Git Product home page Git Product logo

Comments (22)

andrei-a-papou avatar andrei-a-papou commented on May 28, 2024 1

Oh man, now I'm getting error: can't copy 'man/pter.1': doesn't exist or not a regular file even when building from git.

This happens when running python3 ./setup.py build && python3 ./setup.py install

What commands do you issue to build pter from git?

from pter.

vonshednob avatar vonshednob commented on May 28, 2024 1

I'm sorry, the error is slightly different, it's in regard to qpter, not pter. Sorry for the confusion.

No worries, I also missed that.

Here's the actual error: error: can't copy 'man/pter/qpter.1': doesn't exist or not a regular file

Yeah, that was me fumbling the patch. There really is no man/pter/qpter.1 file, but a man/qpter.1 file. 🤦

Anyway, should be fixed with 12ea984a

from pter.

andrei-a-papou avatar andrei-a-papou commented on May 28, 2024 1

Tested with both setup.py and with pip3, you certainly did!

D'you think this issue can be closed?

Sure, it builds just fine now.

from pter.

vonshednob avatar vonshednob commented on May 28, 2024 1

Absolutely! Documentation on the terminal is very much required in my opinion. Just haven't released 3.16 yet.

from pter.

andrei-a-papou avatar andrei-a-papou commented on May 28, 2024

OK, seems like apt install python3-docutils works around the issue, but shouldn't docutils be fetched by setup.py somehow and/or listed as deps? And why doesn't the issue occur with https://vonshednob.cc/releases/?

from pter.

vonshednob avatar vonshednob commented on May 28, 2024

The tarball from my website has been produced with python -m build, so it’s not just the source code, but contains the generated man page, too.

I was rather reluctant to add docutils as a build-time dependency -- the pter package on pypi and on the website, as well as the one in AUR (all the same file, from python -m build) "just work". So adding docutils as a build-time dependency would be an unnecessary step. 🤔

How about adding a Development section to the README and add that type of information there?

from pter.

andrei-a-papou avatar andrei-a-papou commented on May 28, 2024

How about adding a Development section to the README and add that type of information there?

IMO, that would be fine. For the record, this is what I use to build pter inside a Docker image (based on Debian 12/Bookworm):

apt-get install --no-install-recommends -y \
    python3.11-minimal python3-setuptools python3-docutils ca-certificates

cd /path/to/pter-source-dir && \
    python3 ./setup.py build && python3 ./setup.py install

The package ca-certificates is also needed on a minimal Debian install -- without it, no deps like pytodotxt can be downloaded.

from pter.

vonshednob avatar vonshednob commented on May 28, 2024

Interesting, but I remember from my own experience with … uhm, something, that ca-certificates surprisingly is not installed by default. But I guess it makes sense for containers, similar to not installing man pages.

from pter.

andrei-a-papou avatar andrei-a-papou commented on May 28, 2024

But I guess it makes sense for containers, similar to not installing man pages.

Yeah, this is inside the debian:bookworm-slim image. I guess they save space by not installing ca-certificates.

How about adding a Development section to the README and add that type of information there?

I've played with several build options recently and yes, adding instructions on how to build from both kinds of tarballs would be much appreciated.

Right now I can build from both kinds of tarballs using setup.py, but it turns out calling it directly is now deprecated (warnings get printed out).

Building using pip from a source directory fails for me: a man page is not found even after installing docutils. This is with 3.15.2, codeberg tarball. So I couldn't convert to using pip, unfortunately.

Running pip3 install pter works, but then it's hard or very awkward to apply my patches (of which I have more :))

So I'm stuck with using the deprecated setup.py, which works across the board -- for now. It's by no means a blocker, just something that will be hopefully addressed in the future.

from pter.

vonshednob avatar vonshednob commented on May 28, 2024

I think the current thing to do is run python -m build and python -m install. Totally not a circular dependency when you need to install the install package first 🙃

from pter.

andrei-a-papou avatar andrei-a-papou commented on May 28, 2024

OK, I've tried that, it appears to print the same warnings as pip:

warning: no files found matching '*.html' under directory 'pter'                                                                                                                               
warning: no files found matching '*' under directory 'man' 

Then errors out:

error: can't copy 'man/pter.1': doesn't exist or not a regular file

This is with codeberg tarball, v3.15.2. Package python3-docutils installed via apt-get.

(sigh) Back to setup.py :)

from pter.

vonshednob avatar vonshednob commented on May 28, 2024

That's odd. With docutils it should be able to build the man page during python -m build 🤔 maybe there's another dependency that I forgot

from pter.

vonshednob avatar vonshednob commented on May 28, 2024

Okay, I give up for now -- apparently it's far from straight forward to declare a build-time dependency in python. I’ll try to make it not burst into flames when python is being build without having the docutils installed: e12dc7e0. Let me know if this worked.

from pter.

vonshednob avatar vonshednob commented on May 28, 2024

Curious. I just clean-built in an empty virtualenv with that new configuration and it worked. At what step does it crash for you? python setup.py build or python setup.py install?

Edit: right, container… based on it trying to copy, it’s probably the install step.

from pter.

vonshednob avatar vonshednob commented on May 28, 2024

Could you try to use pip install . instead of python setup.py?

from pter.

andrei-a-papou avatar andrei-a-papou commented on May 28, 2024

I'm sorry, the error is slightly different, it's in regard to qpter, not pter. Sorry for the confusion.

Here's the actual error: error: can't copy 'man/pter/qpter.1': doesn't exist or not a regular file

So the install step still fails, but the error is different from the one in #41 (comment)

from pter.

andrei-a-papou avatar andrei-a-papou commented on May 28, 2024

Could you try to use pip install . instead of python setup.py?

Yes, the following worked for me in a Docker container:

apt-get install --no-install-recommends -y \
    python3.11-minimal python3-pip python3-docutils ca-certificates
cd /tmp/pter && pip3 install --break-system-packages . && find /tmp/pter -delete

(For speed of hacking this Dockerfile, I didn't use a virtuaelnv nor do I care for one in an isolated container.)

UPD: apt install python3-docutils doesn't seem to be necessary for a successful build via pip.

from pter.

andrei-a-papou avatar andrei-a-papou commented on May 28, 2024

Now it builds fine via python3 ./setup.py build && python3 ./setup.py install.

But there is a bunch of warnings (they don't appear when building via pip):

doc/pter.config.rst:213: (WARNING/2) Inline literal start-string without end-string.                                                                                                           
doc/pter.config.rst:213: (WARNING/2) Inline literal start-string without end-string.                                                                                                           
doc/pter.config.rst:213: (WARNING/2) Inline literal start-string without end-string.                                                                                                           
doc/pter.config.rst:213: (WARNING/2) Inline literal start-string without end-string. 

The warnings are for the build stage. There are other warnings but they are related to the deprecated use of setup.py.

UPDATE: There are some other warnings (don't know if they are serious), I wrapped them in asterisks in context:

reating build/bdist.linux-x86_64/egg/EGG-INFO
copying pter.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying pter.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying pter.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying pter.egg-info/entry_points.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying pter.egg-info/requires.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying pter.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
**zip_safe flag not set; analyzing archive contents...**
**pter.__pycache__.common.cpython-311: module references __file__**
creating dist
creating 'dist/pter-3.15.2.dev0-py3.11.egg' and adding 'build/bdist.linux-x86_64/egg' to it

from pter.

vonshednob avatar vonshednob commented on May 28, 2024

The line 213 warning is … well, a speciality of trying to express "+-@ " (the last character is a space) in reStructuredText. I’ll verify this later. Thanks for the heads-up!

I guess the big win is that it builds and installs now.

from pter.

andrei-a-papou avatar andrei-a-papou commented on May 28, 2024

I guess the big win is that it builds and installs now.

Absolutely!

from pter.

vonshednob avatar vonshednob commented on May 28, 2024

I think I might have fixed the warning. D'you think this issue can be closed?

from pter.

andrei-a-papou avatar andrei-a-papou commented on May 28, 2024

@vonshednob By the way, will you keep uploading tarballs to https://vonshednob.cc/pter/releases.html? I'm asking since one can build man pages form https://vonshednob.cc releases, which doesn't happen with tarballs from codeberg. And I sometimes need to do man pter :)

from pter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.