Commit Graph

47 Commits

Author SHA1 Message Date
Dylan Baker e991c4d454 Use SPDX-License-Identifier consistently
This replaces all of the Apache blurbs at the start of each file with an
`# SPDX-License-Identifier: Apache-2.0` string. It also fixes existing
uses to be consistent in capitalization, and to be placed above any
copyright notices.

This removes nearly 3000 lines of boilerplate from the project (only
python files), which no developer cares to look at.

SPDX is in common use, particularly in the Linux kernel, and is the
recommended format for Meson's own `project(license: )` field
2023-12-13 15:19:21 -05:00
Eli Schwartz ad525dcce4
bump minimum required version of python to 3.7
Comment out the pending deprecation notice. It cannot be reached
anymore, but is still useful for the next time we do a version bump.
2022-01-10 18:36:56 -05:00
Eli Schwartz d4bdd8318b
setuptools: move stuff to declarative cfg if possible [skip ci]
We're down to just declaring the data files in python now.

setup.cfg can, uniquely, retrieve version info by trying to parse the
AST for simple assignments (which we use) instead of importing the
entire module.
2021-03-10 01:43:21 +02:00
Eli Schwartz 6f9d6858ce setup.py: remove pointless __main__ guard
Since the testsuite no longer tries to import a *script* as a *module*,
there is no need to check if we are in __main__ before running setup().
2021-03-09 22:59:56 +02:00
Eli Schwartz e494be9b02 setuptools: don't hardcode list of modules to install, use find_packages
And don't run a pointless test to verify that the hardcoded list has
been manually maintained correctly. The same test rules used there can
translate directly to find_packages pattern rules.
2021-03-09 22:59:56 +02:00
Dylan Baker 23d3b98fc1 split mesonlib into a package
Currently mesonlib does some import tricks to figure out whether it
needs to use windows or posix specific functions. This is a little
hacky, but works fine. However, the way the typing stubs are implemented
for the msvcrt and fnctl modules will cause mypy to fail on the other
platform, since the functions are not implemented.

To aleviate this (and for slightly cleaner design), I've split mesonlib
into a pacakge with three modules. A universal module contains all of
the platform agnositc code, a win32 module contains window specific
code, a posix module contains the posix specific code, and a platform
module contains no-op implementations. Then the package's __init__ file
imports all of the universal functions and all of the functions from the
approriate platform module, or the no-op versions as fallbacks. This
makes mypy happy, and avoids `if`ing all over the code to switch between
the platform specific code.
2021-01-23 12:48:29 +01:00
Dylan Baker 8d84d4b693 setup.py: fix check fro 3.5.2 which should be 3.6 2020-11-20 15:24:51 -08:00
Daniel Mensinger 05ddd6543d
mdata: remove setuptools and use mesondata instead 2020-07-16 21:03:23 +02:00
Daniel Mensinger 113ec96626
cmake: Fix relative paths for add_custom_{command,target}
Do this by tracking CMAKE_CURRENT_{SOURCE,BINARY}_DIR variables.
This is achieved by injecting CMake code with CMAKE_PROJECT_INCLUDE
and overriding some builtin functions with a wrapper that adds
additional trace information.
2020-02-20 11:16:37 +01:00
Michael Hirsch, Ph.D bbe6db08e3 Minit templates modularization 2019-11-02 23:34:58 +02:00
Michael Hirsch, Ph.D d218d52367 Ensure setuptools via PEP508/518 pyproject.toml 2019-11-02 16:17:13 +02:00
Nirbheek Chauhan 9c2724bce5 Add optional progress bar when generating build.ninja 2019-07-20 17:02:15 +03:00
Dylan Baker d483da46a9 compilers: Move clike into a mixins directory
The compilers module is rather large and confusing, with spaghetti
dependencies going every which way. I'm planning to start breaking out
the internal representations into a mixins submodule, for things that
shouldn't be required outside of the compilers module itself.
2019-07-15 10:59:22 -07:00
Michael Hirsch, Ph.D 23ef8045a9 setup.py >= python 3.5.2 2019-07-11 22:37:25 +03:00
Michael Hirsch, Ph.D 4b9625ac06 ENH: metadata PEP390 setup.cfg
https for Meson docs url

Co-Authored-By: Elliott Sales de Andrade <quantum.analyst@gmail.com>
2019-07-11 22:37:25 +03:00
Daniel Mensinger 98813c1d22
cmake: Added custom target wrapper script 2019-06-28 13:22:37 +02:00
Daniel Mensinger 8d3bd6eea8
cmake: Server handshake 2019-06-06 18:27:01 +02:00
Daniel Mensinger a9930fe066
LLVM: Added CMake backend 2019-05-03 01:39:16 +02:00
Daniel Mensinger cdc338b743
Preliminary CMake module search 2019-02-26 09:33:26 +01:00
Daniel Mensinger 4b3e21b894
Fixed test case and setup.py 2019-01-22 17:47:51 +01:00
Daniel Mensinger a0175ecb14 CMake find_package dependency backend (#4444) 2018-11-22 22:30:12 +02:00
Pieter Krul 87355c8132 Throw error to unsupported Python versions before importing modules from mesonbuild 2018-10-23 20:23:33 +03:00
Nirbheek Chauhan c0413f5d49 setup: Add tests for the installed files list
Ensure that the installed files list matches what we expect, to avoid
surprises at release time.
2018-08-12 01:18:58 +05:30
Nirbheek Chauhan 86298f2109 setup: Require setuptools and entry_points:
This gives us a consistent experience and a simpler setup across all
operating systems. Setuptools is available everywhere these days.
2018-08-11 04:50:55 +05:30
Nirbheek Chauhan 2ee28029f9 Install meson.exe as the entrypoint on Windows
Thanks to Rafael Rivera for the suggestion

Fixes https://github.com/mesonbuild/meson/issues/1877
2018-08-11 03:19:57 +05:30
Jussi Pakkanen b4c635a2e8 Remove long deprecated command scripts. 2018-07-19 01:15:17 +03:00
Ryan Gonzalez 559286a0da Support installation via polkit 2018-05-17 00:23:18 +03:00
Dylan Baker 1ea96b710b setup.py: set the python_requires field
This instructs tools like pip that meson requires python 3.5 or greater,
so if one tries to install on an older version pip will fall back to an
older version of meson.

This won't fix 0.45 since it's already in the wild (unless someone wants
to delete and re-upload the version on pypi). But it should fix future
versions.

Retain the hand rolled version check, but update it to enforce our
actual requirements.
2018-03-07 22:54:01 +02:00
Alistair Thomas 7ab774dee5 Add mesonbuild.compilers to packages in setup.py 2017-06-27 14:12:50 -04:00
Nirbheek Chauhan 67b195f919 setup.py: dependencies is now a directory 2017-05-12 18:54:03 +03:00
Mike Gilbert 69e20735d5 setup.py: install scripts from build_dir
This ensures the installed scripts will have updated shebangs.

Fixes: https://github.com/mesonbuild/meson/issues/1677
2017-04-29 11:21:53 -04:00
Jussi Pakkanen acdf5c2e71 Bump version number for release. 2017-01-29 21:36:29 +02:00
Jussi Pakkanen 5e4f04e8f1 Added man page for mesontest. 2017-01-23 22:14:59 +02:00
Mike Sinkovsky 3adf5aed81 style: [E402] module level import not at top of file 2017-01-11 12:33:27 -05:00
Igor Gnatenko 8268eb4959 tree-wide: remove unused imports
./setup.py:17:1: F401 'os' imported but unused
import os
^
./setup.py:37:1: F401 'stat.ST_MODE' imported but unused
from stat import ST_MODE
^
./run_tests.py:17:1: F401 'os' imported but unused
import subprocess, sys, os
^
./run_tests.py:18:1: F401 'shutil' imported but unused
import shutil
^
./run_unittests.py:23:1: F401 'mesonbuild.dependencies.Qt5Dependency' imported but unused
from mesonbuild.dependencies import PkgConfigDependency, Qt5Dependency
^
./mesonbuild/build.py:15:1: F401 '.coredata' imported but unused
from . import coredata
^
./mesonbuild/interpreter.py:32:1: F401 'subprocess' imported but unused
import os, sys, subprocess, shutil, uuid, re
^
./mesonbuild/interpreter.py:32:1: F401 're' imported but unused
import os, sys, subprocess, shutil, uuid, re
^
./mesonbuild/dependencies.py:23:1: F401 'subprocess' imported but unused
import os, stat, glob, subprocess, shutil
^
./mesonbuild/mesonlib.py:17:1: F401 'sys' imported but unused
import platform, subprocess, operator, os, shutil, re, sys
^
./mesonbuild/modules/qt5.py:15:1: F401 'subprocess' imported but unused
import os, subprocess
^
./mesonbuild/modules/pkgconfig.py:15:1: F401 '..coredata' imported but unused
from .. import coredata, build
^
./mesonbuild/scripts/scanbuild.py:15:1: F401 'sys' imported but unused
import sys, os
^
./mesonbuild/scripts/meson_exe.py:20:1: F401 'subprocess' imported but unused
import subprocess
^
./mesonbuild/scripts/meson_exe.py:22:1: F401 '..mesonlib.MesonException' imported but unused
from ..mesonlib import MesonException, Popen_safe
^
./mesonbuild/scripts/symbolextractor.py:23:1: F401 'subprocess' imported but unused
import os, sys, subprocess
^
./mesonbuild/scripts/symbolextractor.py:25:1: F401 '..mesonlib.MesonException' imported but unused
from ..mesonlib import MesonException, Popen_safe
^
./mesonbuild/scripts/meson_install.py:19:1: F401 '..mesonlib.MesonException' imported but unused
from ..mesonlib import MesonException, Popen_safe
^
./mesonbuild/scripts/yelphelper.py:15:1: F401 'sys' imported but unused
import sys, os
^
./mesonbuild/scripts/yelphelper.py:20:1: F401 '..mesonlib.MesonException' imported but unused
from ..mesonlib import MesonException
^
./mesonbuild/backend/vs2010backend.py:17:1: F401 're' imported but unused
import re
^
./test cases/vala/8 generated sources/src/copy_file.py:3:1: F401 'os' imported but unused
import os
^
./test cases/common/107 postconf/postconf.py:3:1: F401 'sys' imported but unused
import sys, os
^
./test cases/common/129 object only target/obj_generator.py:5:1: F401 'shutil' imported but unused
import sys, shutil, subprocess
^
./test cases/common/57 custom target chain/usetarget/subcomp.py:3:1: F401 'os' imported but unused
import sys, os
^
./test cases/common/95 dep fallback/subprojects/boblib/genbob.py:3:1: F401 'os' imported but unused
import os
^
./test cases/common/98 gen extra/srcgen.py:4:1: F401 'os' imported but unused
import os
^
./test cases/common/113 generatorcustom/gen.py:3:1: F401 'os' imported but unused
import sys, os
^
./test cases/common/113 generatorcustom/catter.py:3:1: F401 'os' imported but unused
import sys, os
^
./test cases/common/59 object generator/obj_generator.py:5:1: F401 'shutil' imported but unused
import sys, shutil, subprocess
^

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2016-12-19 18:19:35 +01:00
Minijackson 8652b94c4f Install mesontest script along with the others 2016-11-26 12:57:36 -05:00
Patrick Griffis 999669e850 setup.py: On Unix install scripts without .py suffix 2016-10-11 00:16:46 +03:00
Nirbheek Chauhan 71f18226d1 Remove unmaintained and broken PyQt5 GUI (#574) 2016-05-30 21:58:26 +03:00
Jussi Pakkanen 46c324eb6e Error out if trying to install with Python 2. 2016-03-28 13:00:08 +03:00
Jussi Pakkanen 455e55f8e5 Back to .py suffix in files. Closes #394. 2016-03-02 21:49:29 +02:00
Jussi Pakkanen 4319f002a1 Tweak setup.py includes. 2016-01-23 20:25:19 +02:00
Jussi Pakkanen 7492724655 Fix wraptool. 2016-01-16 23:59:05 +02:00
Jussi Pakkanen 84456537da Fix some issues that break pypi installs and bump version to upload new version. 2016-01-16 20:59:34 +02:00
Jussi Pakkanen 2f868a19c6 Some text tweaks. 2016-01-16 20:29:53 +02:00
Jussi Pakkanen 5a77aff4ad Removed custom tar generator. 2016-01-16 20:13:56 +02:00
Jussi Pakkanen 2e42427d4a Support both setuptools and distutils. 2016-01-16 20:09:47 +02:00
Jussi Pakkanen 53688207ab Added distutils setup.py. 2016-01-16 19:50:29 +02:00