Giter VIP home page Giter VIP logo

Comments (11)

fnrizzi avatar fnrizzi commented on July 19, 2024 1

ok can you change that please?

from pressio-demoapps.

marcinwrobel1986 avatar marcinwrobel1986 commented on July 19, 2024

Hello,
based on Why you shouldn't invoke setup.py directly, there are a few things which needs to be pointed out:

  • packeges setup should follow PEP517 and PEP518
  • setuptools is effectively deprecated, but there are no warnings anywhere
  • almost all development and maintenance on setuptools is done by Jason R. Coombs, who also maintains nearly 150 other Python packages

Summary:

  • The setuptools project has stopped maintaining all direct invocations of setup.py years ago, and distutils is deprecated. There are undoubtedly many ways that your setup.py-based system is broken today, even if it's not failing loudly or obviously.
  • Direct invocations of setup.py cannot bootstrap their own dependencies, and so some CLI is necessary for dependency management
  • The setuptools project no longer wants to provide any public CLI, and will be actively removing the existing interface (though the time scale for this is long).
  • PEP 517, 518 and other standards-based packaging are the future of the Python ecosystem and a lot of progress has been made on making this upgrade seamless.
setup.py command python -m build (with build)
setup.py sdist or setup.py bdist_wheel python -m build (with build)
setup.py test pytest (usually via tox or nox)
setup.py install pip install
setup.py develop pip install -e
setup.py upload twine upload (with twine)
setup.py check twine check (this doesn't do all the same checks but it's a start)
Custom commands tox and nox environments

from pressio-demoapps.

fnrizzi avatar fnrizzi commented on July 19, 2024

@marcinwrobel1986 after merging your branch, I get this:

pip3 build.py # this works

# then I do: 
pip3 install .
DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no longer work in the near future. If you are using a Homebrew or Linuxbrew Python, please see discussion at https://github.com/Homebrew/homebrew-core/issues/76621
WARNING: Ignoring invalid distribution -ressiodemoapps (/usr/local/lib/python3.9/site-packages)
WARNING: Ignoring invalid distribution -ressiodemoapps (/usr/local/lib/python3.9/site-packages)
Processing /Users/fnrizzi/Desktop/work/ROM/gitrepos/pressio-demoapps
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: pressiodemoapps
  Building wheel for pressiodemoapps (pyproject.toml) ... done
  Created wheel for pressiodemoapps: filename=pressiodemoapps-0.1.0rc1-py3-none-any.whl size=275737 sha256=8d52394dfdfcd308a9186043cc1f38c67bc063904d56d2136b4406c257f18f17
  Stored in directory: /Users/fnrizzi/Library/Caches/pip/wheels/26/70/92/f9c808f7df02b9cf525aae1425350662e075261b2a1ba9dbd8
Successfully built pressiodemoapps
WARNING: Ignoring invalid distribution -ressiodemoapps (/usr/local/lib/python3.9/site-packages)
Installing collected packages: pressiodemoapps
DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no longer work in the near future. If you are using a Homebrew or Linuxbrew Python, please see discussion at https://github.com/Homebrew/homebrew-core/issues/76621
WARNING: Ignoring invalid distribution -ressiodemoapps (/usr/local/lib/python3.9/site-packages)
Successfully installed pressiodemoapps-0.1.0rc1
WARNING: Ignoring invalid distribution -ressiodemoapps (/usr/local/lib/python3.9/site-packages)
WARNING: Ignoring invalid distribution -ressiodemoapps (/usr/local/lib/python3.9/site-packages)

are all those warnings expected?

from pressio-demoapps.

fnrizzi avatar fnrizzi commented on July 19, 2024

@marcinwrobel1986

  • another thing is missing: how do I specify the build mode? Release vs debug? this was missing in the documentation
  • you edits the documention in the wrong place: you edited files insde docs/_sources but should have edited files inside docs/src

from pressio-demoapps.

marcinwrobel1986 avatar marcinwrobel1986 commented on July 19, 2024

@marcinwrobel1986 after merging your branch, I get this:

pip3 build.py # this works

# then I do: 
pip3 install .
DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no longer work in the near future. If you are using a Homebrew or Linuxbrew Python, please see discussion at https://github.com/Homebrew/homebrew-core/issues/76621
WARNING: Ignoring invalid distribution -ressiodemoapps (/usr/local/lib/python3.9/site-packages)
WARNING: Ignoring invalid distribution -ressiodemoapps (/usr/local/lib/python3.9/site-packages)
Processing /Users/fnrizzi/Desktop/work/ROM/gitrepos/pressio-demoapps
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: pressiodemoapps
  Building wheel for pressiodemoapps (pyproject.toml) ... done
  Created wheel for pressiodemoapps: filename=pressiodemoapps-0.1.0rc1-py3-none-any.whl size=275737 sha256=8d52394dfdfcd308a9186043cc1f38c67bc063904d56d2136b4406c257f18f17
  Stored in directory: /Users/fnrizzi/Library/Caches/pip/wheels/26/70/92/f9c808f7df02b9cf525aae1425350662e075261b2a1ba9dbd8
Successfully built pressiodemoapps
WARNING: Ignoring invalid distribution -ressiodemoapps (/usr/local/lib/python3.9/site-packages)
Installing collected packages: pressiodemoapps
DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no longer work in the near future. If you are using a Homebrew or Linuxbrew Python, please see discussion at https://github.com/Homebrew/homebrew-core/issues/76621
WARNING: Ignoring invalid distribution -ressiodemoapps (/usr/local/lib/python3.9/site-packages)
Successfully installed pressiodemoapps-0.1.0rc1
WARNING: Ignoring invalid distribution -ressiodemoapps (/usr/local/lib/python3.9/site-packages)
WARNING: Ignoring invalid distribution -ressiodemoapps (/usr/local/lib/python3.9/site-packages)

are all those warnings expected?

Hi Francesco,
should be:

python build.py

# this script taked command line arguments, so you can go with:
python build.py --help

# you will get the answer
usage: build.py [-h] [--openmp] [--build_mode BUILD_MODE]

optional arguments:
  -h, --help            show this help message and exit
  --openmp              Enables OpenMP if given
  --build_mode BUILD_MODE
                        Defines build mode: Release or Debug

The above simply means that, --openmp is a boolean type, so when specified then it's true, otherwise is false, regarding --build_mode you need to pass it Release or Debug, which I think is described in help, but could be --build_mode=Release or --build_mode Release, same with debug

Regarding DEPRECATION messages, please don't worry about that, we are PEP517 and PEP518 compatible.

I will create a PR on Monday to fix the docs.

For building the package we use build and the command we use is:

python -m build

from pressio-demoapps.

fnrizzi avatar fnrizzi commented on July 19, 2024

@marcinwrobel1986 thanks! Ok we are all good.
Just to verify, to INSTALL it, one ALWYS has to do:

python build.py 
pip install .

Right?

I fixed the docs (I need to fix some bugs with openmp in python, so i omitted that now in docs) .

So we are all good.

from pressio-demoapps.

fnrizzi avatar fnrizzi commented on July 19, 2024

@marcinwrobel1986 it seems that if i try:

python build.py --user 

does not work. I get a bunch of proxy errors. The old way (python setup.py install) works however. any idea?

from pressio-demoapps.

marcinwrobel1986 avatar marcinwrobel1986 commented on July 19, 2024

@marcinwrobel1986 it seems that if i try:

python build.py --user 

does not work. I get a bunch of proxy errors. The old way (python setup.py install) works however. any idea?

Hi Francesco,

python build.py --help

if you want help. If you just want to build with OpenMP then:

python build.py --openmp

@marcinwrobel1986 sorry i meant: pip install --user . does not work , i get a bunch of proxy errros

I tried on develop branch, not in virtual env and worked for me:

pip install --user .
Processing /home/marcin/Dokumenty/NGA/projects/pressio-demoapps
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: pressiodemoapps
  Building wheel for pressiodemoapps (pyproject.toml) ... done
  Created wheel for pressiodemoapps: filename=pressiodemoapps-0.1.0rc1-py3-none-any.whl size=273390 sha256=c1d68965abbba689df5464e33f974895508475482d169d17057a0aeaba58350c
  Stored in directory: /home/marcin/.cache/pip/wheels/06/92/45/110174e2547693a3c193e2ecd6d258198fa35c48df2b397535
Successfully built pressiodemoapps
Installing collected packages: pressiodemoapps
Successfully installed pressiodemoapps-0.1.0rc1

from pressio-demoapps.

marcinwrobel1986 avatar marcinwrobel1986 commented on July 19, 2024

BTW this build script is mine script to build library with CMake, it has nothing to do with building or installing Python package.
This is done with:
Just building:

python -m build

Building and installing at once:

pip install .

from pressio-demoapps.

fnrizzi avatar fnrizzi commented on July 19, 2024

@marcinwrobel1986
sorry i meant: pip install --user . does not work , i get a bunch of proxy errros

from pressio-demoapps.

marcinwrobel1986 avatar marcinwrobel1986 commented on July 19, 2024

Ok, I noticed one more problem, remember when you wanted me to change the name of the script from cmake_build.py to build.py? This has a conflict now, because then you call python -m build, then the script is ran instead of the build package which is called build :/ I propose to get back to cmake_build.py

from pressio-demoapps.

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.